Support » Plugin: Participants Database » Relationship between records

  • Resolved eljailer


    Hi there!
    Is it possible to create some kind of relationships between records?
    The idea is to create one field in one of record’s field groups that lists other records and makes it possible to select them as multiselect dropdown.
    If the answer is too complex, at least point me in right direction, please.
    Thank you in advance!
    And thank you for this awesome plugin!

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


    The plugin doesn’t have this kind of thing built in. It is possible to set that up, but it is complex and you’d have to be a pretty good coder to do it.

    How you do it really depends on how you need it to work and what you’re trying to do with it.

    After some research, I gave up on that idea.
    This is what I need:
    I have a database of guests. Those guests come and go, but each time they come back they have a different ‘role’, one of few that are predefined.
    Is it possible to create custom list template to show the roles and visiting dates of just one record (person) and show that on single record page? I’m thinkig something similar to this, but it would show the visiting list of just one person, based on some criteria, instead of record edit form.
    Thank you for your reply.

    Plugin Author xnau webdesign


    Well, you certainly could use the database as a guest record (each time a guest comes, a record is made of their visit) and then it wouldn’t be hard to set up a display of a list of all the visits a single guest has made. Or a list of all the guests that have served in a role.

    Please help!
    I’m having trouble filtering the list.
    How to filter list based on 3 criteria (last name, first name and social security number)? I created custom template, but this is a problem for me.
    Help would be much appreciated.
    Thank you in advance!!!

    Plugin Author xnau webdesign


    You can combine filters in the list shortcode. Take a look at the docs:

    List Shortcode Filters

    Thank you for your reply.

    I’m still having trouble sorting this out, though.
    How can I include filter as a dynamic value?

    I created a custom tab on the pdb-single page and the idea is to put
    the pdb_list shortcode inside that tab that would display only values
    filtered by last_name, first_name, but the those values should be dynamic, based on the curren record (pdb_single).

    Thank you in advance!

    Plugin Author xnau webdesign


    Filters are only applicable to list displays, not the single record display.

    You can determine which fields are shown in the shortcode by using the “fields” or “groups” attribute. That is one way you could, for instance, show the record broken up into tabs if your WP theme has a way to create tabs on your page.

    For example:

    tab 1:
    [pdb_single groups=”main”]

    tab 2
    [pdb_single groups=”address”]


    I’m already using this solution with Shortcodes Ultimate Plugin and it works well with pdb shortcodes.

    I need something like this:

    $this_guest = new PDb_Template($this); 
      global $wpdb; 
      $query = '
        SELECT last_name, first_name, role 
        FROM ' . $wpdb->prefix . 'participants_database 
        WHERE last_name LIKE '.$guestHistory.'"

    How do I implement this in a pdb_list custom template?
    If it’s too much to ask, please disregard this post, I will close the thread. Thank you anyway!!!

    • This reply was modified 1 year, 11 months ago by eljailer.
    Plugin Author xnau webdesign


    You can do this in a custom template for the single record.

    For example:

    $guestHistory = $this->participant_values['last_name'];
    echo do_shortcode( '[pdb_list fields="first_name,last_name,role" filter="last_name=' . $guestHistory . '"]' );

    You can put that after or before the main body of the single record template.

    This works perfectly!
    Thank you so much!!!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Relationship between records’ is closed to new replies.