Okay
  Public Ticket #3305643
attach a URL column to another text column
Closed

Comments

  • Wenhao started the conversation

    Hi!

    Is there a way to attach multiple URL links together to another text column with multiple texts (each can be clicked through to open a new, different tab)? I was able to create multiple URL columns according to the wptable documentation but not sure how to put multiple URLs into one single column. I tried to look around the documentation but couldn't find a solution. 

    Can you help?

    Thanks!

  •  1,667
    Miloš replied

    Hi, Wenhao.

    Sorry for the delay,

    and i am not sure if i fully understood the exact use-case.

    1. If you simply need to be able to place multiple links together in same cell,

    you can not use an URL Column, because in this column type, it is going to render the entire cell value as a single link.


    To set up multiple links together in same cell, you have to use our String type column,

    and wrap each link in a HTML anchor tag, for example :

    <a href="url">link text</a> <a href="url">link text</a> <a href="url">link text</a>

    This will render three different links together in same cell, and each of them will be clickable.

    If you need to add "open in a new tab",  just add a target "blank" attribute, that determines if the link should be open in a new tab or not.

    For example, this will open it in a new tab :

    <a href="url" target="_blank">link text</a>


    2. If you wish to input some "plain text" together with hyperlinks in same cell combined,

    you can also use our String type column for that;

    it can render custom HTML - so,  you will need to format the cells in a certain way.

    If you need multiple lines, then It has to be a 'multi-line string', and the same for the editor type in the Editing setting of that column,

    ( If it is an editable table - if it is not editable, then ignore that part);

    then you can directly input text,  and for links, use HTML anchor tags and <br> for new lines.

    For example, a cell can be formatted like this :

    Auxito 10S <br>
    Buy <a href="https://LinkToAmazon">Amazon</a>
    Buy <a href="https://LinkToDirect">Direct</a>
    Buy <a href="https://LinkToAliExpress">AliExpress</a>

    And if i make this in a table, it will be like this :

    5295483771.png

    6140275930.png

    5142621607.png

    As you see, any content we wrap in HTML anchor tags gets properly rendered as links, while other text is just rendered as plain text.

    Of course, you can add custom CSS to customize the fonts, colors, etc.

    Please check more about customizing cells/columns here.

    -

    Let me know if that helps. 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