• Resolved franc3s

    (@franc3s)


    Hi, I have another question..

    After setting up a page with the [pdb_single] shortcode, I’ve setted this page to be the one to display the participant single page. I’ve selected the field on which to put the link to the [pdb_single] shortcode. The list works great, the url is auto generated and correctly displays the record infos.

    But my problem is that only a part of the people of this list shoud have their own page. Other participants should not have the single page. But both of the group must be displayed in the same list in the same page.

    Basically, the single page shoud satisfy another field. If this field is setted to yes, I need the single page. But if this field is setted with no, this participant should not have a page.

    Can u help me doing this?

    https://www.ads-software.com/extend/plugins/participants-database/

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

    (@xnau)

    franc3s,

    You’ll have to create a custom template for the list shortcode. How to do this is explained here: https://www.ads-software.com/extend/plugins/participants-database/other_notes/

    In this template, you check for the field that you want to put the link on, and if it doesn’t have the ‘yes’ value, don’t show it. Let’s say your field is named ‘detail’… put this in the custom template on it own line after the $this->the_record(); ?> statement:

    <?php if ($this->record->fields['detail']->value != 'yes' ) $this->record->fields['detail']->form_element = 'hidden' ?>

    Now, you need to “trick” the plugin into accepting your ‘detail’ field, because you want it to be a checkbox and the plugin won’t let you set checkboxes as a link field. So, create your ‘detail’ field, then set the list setting so that it is the link field. Now, change the field type of the ‘detail’ field to ‘checkbox’ and set the values to “yes,no”

    That should do it.

    Thread Starter franc3s

    (@franc3s)

    Thank you for your quick response!

    I’ve created another file like the pdb-list-detailed.php but I can’t find the $this->the_record(); ?> statement.. Am I looking the correct template? Can you help me?

    Thank you very very much

    Thread Starter franc3s

    (@franc3s)

    Ok, great, I did it!!!
    You are a damn3d GENIUS!!!!

    For future reference, after line 111 ( <?php while ( $this->have_records() ) : $this->the_record(); // each record is one row ?> )

    I added what you told me!

    I probably will ask you something more, I’m using your plugin for a sport charity project!

    Plugin Author xnau webdesign

    (@xnau)

    franc3s,

    Glad it worked for you… I know that line is slightly different in the default template, but the only thing that matters is the $this->the_record() statement and it can look different in a custom template.

    Thread Starter franc3s

    (@franc3s)

    I didn’t understood your reply :/
    I used the detailed template, is it fine what I did, right? It works, but I hope it’s correct!

    (I’ve changed yes to view, so that in the detail column I have, instead of a yes link, a “view” link)

    Plugin Author xnau webdesign

    (@xnau)

    it wasn’t important…glad you got it working.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Single page only for some people in the list’ is closed to new replies.