• Hi Peter,

    I think you might already have the solution for this question.

    My database has multiple tables, for example: contact table, and project table. In the project table, it references a project contact as a foreign key.

    When I use data project to list the project, I created the 1:n lookup relationship so it displays the contact name. This is pretty good so far. But I wish I can create a hyperlink on the contact name, so user can click the contact name to access the contact details page.

    Is there a way to do that? If so, please instruct me.

    Thanks.

    Jay

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jay,

    You can use dynamic hyperlinks to add this functionality. Dynamic hyperlinks are explained here:
    https://wpdataaccess.com/docs/documentation/data-explorer/dynamic-hyperlinks/

    You can display dynamic hyperlinks in any format. Even add your own icons. Don’t forget to add them to your project!

    Hope this helps,
    Peter

    Thread Starter Pixel Wall

    (@pixw)

    Peter,

    I read the hyperlinks section of the document, however, the example you have shows this feature will create additional column you need to have a URL where you can insert the $$id$$. This is different from the hyper link I was thinking about.

    In my case, I want to just underline the name that’s linked to the foreign key, and when user click, it will bring to the view page of that record.

    The document doesn’t show how to reference to the view page of a data element.

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jay,

    What kind of page is the contact detail page? Is it a back-end or front-end page? If it is a front-end page, which shortcode are you using?

    Thanks,
    Peter

    Thread Starter Pixel Wall

    (@pixw)

    I am talking about the front page. Most of our page use diahard shortcode to insert data table. So, it will be nice if we can hyperlink a column in a table and jump to the view page of that record.

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Jay,

    To add a dynamic hyperlink to a Data Project, you need to activate the hyperlink in your project template. It is disabled by default. Edit your project template and enable the hyperlink in Table Settings. That will do.

    Within a dynamic hyperlink you can only use column values that belong to the base table. It is not possible to access columns of other tables.

    When you jump to another project page, you can use URL parameters to filter. This is documented here:
    https://wpdataaccess.com/docs/documentation/data-projects/adding-filters/#url-parameters

    Does this help?
    Peter

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Hyperlink records from different table’ is closed to new replies.