Okay
  Public Ticket #3667266
Make field value a clickable dynamic link
Closed

Comments

  • Adam Acord started the conversation

    Say I have a table that displays zip codes and some financial statistics for each zip.  I want to make the zip code values (first column in table) each a clickable link.  I found a few sites I might want to use with a fixed URL for each zip, one is city-data.com.  If their format for a URL is "https://www.city-data.com/zips/78230.html", how would I make the 78230 zip code link to that URL?

    Bonus points for being able to target a new browser tab...

  •  1,805
    Miloš replied

    Hi Adam,

    Sorry for the waiting time.

    We don't work on weekends so it adds two days to the waiting time.

    we appreciate your patience.


    If I understand, you wish to somehow 'extract' only the zip code from this entire value?

    If that is the case, we don't have a way to do this at the moment.


    Right now, when we wish to make custom dynamic links, we have an 'opposite approach', for example if you have some 'split values' in several columns and you wish to add custom HTML around these column values while being able to combine multiple column values;

    If you wish to try something like that, please check out our Transform Value feature.


    Here is an example :

    Let's say if we have separate data for the hyperlink into two columns;

    - One column for the 'URL link itself'

    - And another column to store the 'displayed text' for the hyperlink.

    Then, with our Transform value feature - you can use a String Column in our Table and create a dynamic custom HTML a href tag and inside it you can call these column placeholders.

    ( Optionally you can of course add 'target blank attribute' to open the link in a new tab)

    For example, let's say we called the URL column just "URL" and the other Column "displayed text".

    Then, the Transform Value would be something like this :

    <a href="{URL.value}" target="_blank">{displayed text.value}</a>
    

    Then the String Column in which you used this is going to render each row to pull the values from the respective column placeholders and it will all be wrapped as this Custom Hyperlink HTML.

    You can check out the Documentation Page i sent above to see more detailed examples how you can use the Transform Value feature.


    The only other way is to manually edit each cell in your source data, and if you need each row/cell to have a different hyperlink displayed name - then you have to write the Custom HTML hyperlink in each cell individually.

    So I believe the Transform Value can save you a lot of manual work.


    I hope that helps, but let me know how it goes and if I misunderstood the goal.

    Thank you.



    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Adam Acord replied

    That worked beautifully!  Thank you so much!

  •  1,805
    Miloš replied

    Hi Adam,

    I am delighted to hear that this has been helpful for your use-case.

     Thank you for letting us know. 

    Anything else that we could assist with, please don't hesitate to create new ticketssmile.png.



    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables