Okay
  Public Ticket #3198817
Clickable link of foreign key value in table
Closed

Comments

  • Simon Uve started the conversation

    Hi, I purchased WpDataTables on Envato several years back. Now I want to purchase several add-ons too but not sure if they will do what I want.

    I want the table row values to be clickable links if they are foreign key values in mySQL table so that customers can explore more about the foreign key values.

  •  1,819
    Miloš replied

    Hi, Simon 

    My apologies for the late response.

    We had a New Years break and are back,   will do our best to be quick with our responses going forward.

    I wish you a Happy New Year, and all the best in 2023!smile.png

    -

    I am sorry, but i did not quite understand this use-case.

    Could you please elaborate a bit more about your goal and we can advise if it's possible?

    For example, if you need to hide some columns in a "more details" section,

    and then, on a click of a row to open a Pop Up , or Post or Template Page,  that holds more details with placeholders of all the "hidden columns" that you chose,

    then it can load all the data about this row,

    for that you can try our Master-Details add-on.

    Before purchase, you can test all the Master Detail Add-on features on this sandbox site.

    Let me know if that is what you meant?


    2.  If you meant to achieve something else, such as a specific link, can you elaborate more,

    if you could provide any kind of working examples, or a video? 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

  • Ørjan Strømmen replied

    I'm also looking for this.

    In table A i have a URL I would like to be shown in table B.

    But the URL only show as string in Table B. Is it possible to show it as a hyperlink, or a button?

  •  1,819
    Miloš replied

    Hi, Ørjan.

    I will advise in details how you can make hyperlinks and make buttons in our tables.

    There are two ways how you can make URL buttons in the cells of our tables.

    -

    1.

    If you use our URL type columns ( this is the easiest way):

    you can set "Show link as a button" in column settings.

    But you can add additional styles, if you wish.

    First you need to add a custom class to it:

    4698826991.png

    Then, visit this website, generate your button, and click on "Get Code":

    6639315205.png

    In the right part of the screen, you'll see the code you need for this button:

    9848024905.png

    Copy the code without the first row and change "myButton" to the custom class you added in step 1, so instead of this:

    .myButton {
        background-color:#51d1c6;
        border-radius:28px;
        border:1px solid #1995ab;
        display:inline-block;
        cursor:pointer;
        color:#ffffff;
        font-family:Arial;
        font-size:17px;
        padding:16px 31px;
        text-decoration:none;
        text-shadow:0px 1px 0px #2f6627;
    }
    .myButton:hover {
        background-color:#5a9615;
    }
    .myButton:active {
        position:relative;
        top:1px;
    }
    

    You would use this:

    .customclass {
        background-color:#51d1c6;
        border-radius:28px;
        border:1px solid #1995ab;
        display:inline-block;
        cursor:pointer;
        color:#ffffff;
        font-family:Arial;
        font-size:17px;
        padding:16px 31px;
        text-decoration:none;
        text-shadow:0px 1px 0px #2f6627;
    }
    .customclass:hover {
        background-color:#5a9615;
    }
    .customclass:active {
        position:relative;
        top:1px;
    }

    In the table, go to Customize/Custom CSS and paste that code:

    5662287483.png

    Notice that the font color had to include the !important clause to override the color of the text in the button. After you add this, the button in the table will look like this:

    4803006689.png

    2.

    Or, if you wish to use a string type column ( This is more useful if you  need multiple links in same cell):

    If you use a one line string, it will be limited to 255 characters; 

     if you use multi line string - it will have 65,535 character limit.

    Please check out this documentation about our text fields;

    The cells will render HTML, so you can wrap links in anchor tags, for example,

    <a href="https://www.w3schools.com">Visit W3Schools.com!</a>
    

    this would render in cell as "Visit W3Schools.com!"  as the displayed text, but it will  lead to the link when clicked;

    and the other regular text fields will simply be rendered as text;

    -

    You can also style it, if you add an ID, or a class in my example :

    <a href="yourURL" class="customButton">Link Text</a>

    You can then add some custom CSS styles to the table, in Customise tab > Custom CSS;

    On my example i will make it look like a green button:

    .customButton {
      background-color: #4CAF50;
      border: none; 
     color: white; 
     padding: 15px 32px; 
     text-align: center; 
     text-decoration: none; 
     display: inline-block; 
     font-size: 16px; 
     margin: 4px 2px;
      cursor: pointer;
    }
    

    and it would look like this :

    6674728901.png

    -

    Let me know how that sounds, and if you have any questions. smile.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