Okay
  Public Ticket #1966940
URL Display - Image Instead
Closed

Comments

  • zarilla started the conversation

    Okay I'm not the perfect CSS programmer.

    I have a list with a URL in one column. I don't want to just display the URL because it look bad. I would like to do a conditional image. If it is LinkedIn it shows that Image. If it is Wikipedia it shows that image. 

    Can some please help me know what the best way to do this is?

    Thank you,

    Zarilla

  • zarilla replied

    I'm doing this so that people cannot just cut and paste the entire URL list.


  •  2,572
    Aleksandar replied

    Hello zarilla.

    Thank you for your purchase.

    This could be done, of course. I'm guessing you're looking for something like this:

    4979677602.png

    So, when a user clicks on the icon - it takes them to the user's profile on that network, correct?

    Now, to do this, you'd need to upload the icons to your WordPress' Media Library. When you open it, you'll find the URL to the icon (see attachment).

    In order to make that a clickable link, the column's type needs to be set as "String", and editor input type "One-line edit" or "Multi-line edit". Now, when you're adding a row, the cell needs to look like this:

    <a href="https://www.linkedin.com" target="_blank"><img src="http://localhost/wpdt-2.5/wp-content/uploads/2019/04/square-linkedin-512.png" height="42" width="42"></a>

    It probably won't work in back-end, but in front-end it works flawlessly.

    Please let me know if this helps.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [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