• Resolved toroby

    (@toroby)


    Hello,

    In short:
    I am looking to use the PDB to show information (on a page) about a certain user, while controlling where each fields show using the shortcodes. Would it be possible to do a shortcode like [pdb_single pdb=2 first_name] so that it only shows the first_name field of user pdb2? Then I can control where that first name shows based on the design of my page.

    In long:
    I would like to control which fields show in different areas of my page. I was hoping to use the shortcodes to do this.

    For example if I have a user pdb=2 with first_name and last_name and country fields entered in by the user. I would like to display that information on a page dedicated to that user, that is designed in a certain format. That page would be http://www.site.com/user-name

    That page, has a certain layout and I would like the information in pdb=2 to show in different areas of the layout. For example near the footer, I would like to display the “country” field, while at the top of the page I would like to display “fist_name” and “last_name” field. Can I do this using short codes?

    Any pointers would be appreciated.

Viewing 1 replies (of 1 total)
  • Thread Starter toroby

    (@toroby)

    The answer was in the pdb-single-single-value.php of the plugin. I didn’t understand the custom templates section of the documentation, sorry I didn’t look further before asking.

    /*
    * template for showing a single value from a record
    *
    * the field to show must be defined in the shortcode using the “fields” attribute:
    * [pdb_single template=”single-value” fields=”first_name”]
    *
    * this template requres the id of the record to get the value from be provided,
    * either as a variable in the URI (?pdb=123) or as a shortcode attribute
    * [pdb_single template=”single-value” record_id=”123″ fields=”first_name”]
    *
    */

Viewing 1 replies (of 1 total)

The topic ‘Show Specific Fields from certain users’ is closed to new replies.