• Resolved iyogai

    (@iyogai)


    I need users to be able to click on an entire list record and be directed to the record ‘single page’ not a ‘Single Record Link Field’ which we set in the settings.

    IF THAT’S NOT DOABLE THEN:

    How can I let users click on more than a single field? for example on record ‘photo’ as well as ‘name’.

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

    (@xnau)

    This is possible, you will need to use some custom code on the pdb-single_record_link_field filter, it determines which field is getting the link, so you can put it on all the fields if you want.

    Another approach is to set up a custom template that places your single record link on the fields you want to be clickable.


    Using Participants Database Custom Templates

    Thread Starter iyogai

    (@iyogai)

    I used pdb-single_record_link_field in my custom template that displays the list of records. I also set the Single Record Link Field to one of the fields as well as None. Nothing worked. I’m wondering if I must place the code at a specific place.

    Here’s the code I used (just your code with different field names):

    <?php
    /**
     * add fields to the single record links
     *
     * @param array $fields the defined single record fields
     * @return array
     */
    function xnau_set_single_record_link_fields( $fields ) {
      return array_merge( $fields, array( 'first_name_teacher','middle_name_teacher','last_name_teacher','photo_teacher' ) );
    }
    add_filter( 'pdb-single_record_link_field', 'xnau_set_single_record_link_fields' );
    ?>
    Plugin Author xnau webdesign

    (@xnau)

    The code looks good.

    The code must be placed either in your child theme functions.php file or as a simple plugin.

    • This reply was modified 5 years, 5 months ago by xnau webdesign.
    • This reply was modified 5 years, 5 months ago by xnau webdesign. Reason: got it wrong at first
    Thread Starter iyogai

    (@iyogai)

    Worked like a breeze. Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multiple “Single Record Link Field”’ is closed to new replies.