WordPress.org

Ready to get started?Download WordPress

Forums

Participants Database
[resolved] pdb-single customization help (4 posts)

  1. cbrendlinger
    Member
    Posted 1 year ago #

    I have built several custom templates but am totally stumped with this. I have searched all of the support topics and your guides but have been unable to find a solution. I would like to be able to display only certain fields based on the type of record the participant has completed. I have a basic form and a premium form... obviously, the premium form has more fields available. However, from the pdb-list (where I list all of my members) I want to be able to click on a member and display only certain fields. I really appreciate having the $exclude array to work with but I need a way to determine what type of record I am looking at and then change the array accordingly. I have not yet implemented the database so sending you to my site will be of no value. I know this has to be a simple modification to the pdb-single template that I have created (by copying the default). By the way, I did create a field called 'type' with a default value of 'Basic" and an optional value of 'Premium.' I have been unable to get an IF statement to properly evaluate the value. Any insight would be greatly appreciated. Thanks!

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

  2. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    This is pretty easy. All the values of a record are available in the "record" object in the template. Getting the value of a particular field is slightly complicated. For instance, if you wanted to get the value of your "basic" field and it was in the "main" group (fields are organized by group) you would use this to get that value:

    $this->record->main->fields->basic->value

    The format for that is: $this->record->(group name)->fields->(field name)->value (this is not real PHP code, just showing you how the object is structured).

    You should have no trouble building an IF statement from that.

  3. cbrendlinger
    Member
    Posted 1 year ago #

    Thank you so much for the quick response! I was missing the group reference. I think I can get there from here. By the way... This is the BEST plugin ever and I truly appreciate the amazing support that you provide for it.

  4. cbrendlinger
    Member
    Posted 1 year ago #

    And... for the record... it worked like a charm. Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic