• Resolved dachtera

    (@dachtera)


    I have copied the default single template for my use to incorporate a google map URL and image into the template.

    I have reviewed a few of the threads and have been unable to find the proper code to extract a listing for a single field.

    I need to generate a URL with the following syntax:

    http://maps.google.com/maps?q=”.address.”,+”.city.”,+”.state.”+”.zipcode

    I have tried using this code (and similar) inside and outside the default loops, with no results:
    //<? print $this->record->fields[‘city’]->value; ?>

    What is the syntax for outputting single fields from the DB outside the default loop to display all [non-excluded] fields.

    the URL I am setting is up here if it helps: //http://carryfriendly.info/view-locations/view-location-detail/?pdb=1

    Thanks – Tim

    http://wordpress.org/extend/plugins/participants-database/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Tim,

    Well, if you’re curious about the structure of a PHP object, sometimes it helps to use “print_r()” to expose it.

    The way the object is structured is a little more complicated than what you were trying. A field’s value can be accessed with something like this: $this->record->main->fields->city->value where “main” is the name of the group the field is in and “city” is the name of the field.

    Thread Starter dachtera

    (@dachtera)

    Thank you, This is just what I was looking for. Short of a few other data scrubbing things, this will be just what I need.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Display specific fields in single custom template’ is closed to new replies.