• I know I can parametise the pdb_list page to display a single record, but can I do the same with the page that contains the pdb_single shortcode so that I can display the full record without having to click through the list view?

    Thanks.

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

    (@xnau)

    You can use the record_id attribute of the pdb_single shortcode to set the record id to show.

    Thread Starter mygrove

    (@mygrove)

    The issue there seems to be that I don’t know that record_id is from my data as it only gets assigned after the record has been added. The ‘term’ attribute seems to suggest it can be used as an alternative but I cannot get the syntax correct.

    Plugin Author xnau webdesign

    (@xnau)

    Maybe you can start by describing what you’re trying to accomplish.

    Thread Starter mygrove

    (@mygrove)

    OK, I have a database of people which can be searched, some records will have a relationship to other people in the same list e.g. parents, father and mother. I want to be able to select any of the three detail records. So if two of my fields had urls to the details page it would achive that. Yes, the record_id works but it is messy as I have to set all those links up manually because I don’t know the record_id in advance. Ideally I would use my regular id field with something like this. Where the page “single-detail” contains a [pdb_single] shortcode.

    /database-detail/?term=id&value=910001
    or
    /single-detail/?term=id&value=910001
    Plugin Author xnau webdesign

    (@xnau)

    If I am understanding you correctly, you’d like to have multiple links for each record in the result set. Each of those links goes to a single record page, one for the record in the result, and some of them for a related record.

    This is certainly possible with a custom template for the list shortcode, you can set it up to show multiple links in the result set. The plugin doesn’t have a way to add multiple single record links, but with a little custom code, you can do it.

    The template operates as a loop, one for each record, and then in each record, there is a loop that shows the fields for that record. You would just insert your custom code into the loop and add the additional links. It would be easiest to have additional fields that are specifically made to take those links (rather then try to add fields in the template, that doesn’t work well).

    There are several tutorials on our website about creating custom templates…for example:

    Using Participants Database Custom Templates
    Using the PDb_Template Helper Class in a Custom List Template
    Adding an Edit Record Link to the Frontend List

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Access a single detail page’ is closed to new replies.