Okay
  Public Ticket #3653302
Like button for table entity in wpDataTables
Closed

Comments

  • Felix started the conversation

    Good day guys,

    Is there any possibility to add a like button for one, several or all entities of a table in wpDataTables?

    So, that a logged in user is able to like certain entries of a table?

    I double checked your great documentation/manual and found: https://wpdatatables.com/faqmd/disable-opening-links-popup-make-like-button/

    But unfortunatelly it doesn't help me any further.

    3339455090.png

    I pretty much love your videos & clips on youtube (https://www.youtube.com/@wpDataTables). Those are awesome and a great help Basically one of the main reasons, why I did chose wpDataTables over something else. But also there I didn't find anything specific regarindg a like button for entities in tables.

    You may can help me with that?

    Thanks a lot

    Felix


  •  1,744
    Miloš replied

    Hi Felix,

    That specific article from the FAQ section was only explaining that, during that time in 2018's update 2.1 we introduced the option to set the link in our URL type Columns to be 'displayed as a button'.

    7059153339.png

    We will edit the title of the FAQ to make it clearer for users for the future.

    You can see more details about all these URL Column options on this Documentation.

    1305886659.png

    -


    In regards to your use-case, to set up a column which can be used as a "like" button, for users to click into it to like the selected row;

    we don't have an easy 'out of the box' option at the moment.

    You can suggest it to our developers, though - they will do their best to make a built-in solution in the future.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.

    -


    If you have coding skills and wish to try to make a custom solution now, I can only try to advise for a possible custom workaround, to try and set it up so it 'looks as a LIKE button' when a user clicks/edits a column in a row.

    Here is my example of one way how you can try to at least 'visually' present a 'liked' row via our editing selectBox options.

    If I add a String Column to this Manual Table, and set editing as "Single value SelectBox";

    then we predefine manual values for SelectBox as "Like" or "Dislike";

    or if you don't wish 'dislike' you can just leave 'empty value' as possible selection so each row will be blank by default.

    9562693090.png

    We set the possible manual editing SelectBox values under the Data tab in Column settings.

    7163330384.png

    Then, if a user edits a row, in this Column they choose "Like".

    9610295222.png

    1251263041.png

    Now, we add a Conditional Rule via our Conditional Formatting Feature to this column; and set it to change the content to custom HTML if the value is "Like".

    I will just use a free image I found for the "like" icon online, download this, upload to the Media Library and use it like this :

    1043997753.png

    In my example, I use a LocalHost Site, so I make a HTML img tag with the source to my URL to this image from my Media Library and I will add additional text next to the image as "Liked" :


    <img src="http://localhost/current/wp-content/uploads/2024/05/icons8-like-50.png">  Liked
    
    6508883265.png

    So at the moment, you can only try custom workarounds like that with our Conditional Formatting to 'transform' the content of the cell to a 'liked' image, etc.

    I hope that helps.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

  •  1,744
    Miloš replied

    Hi Felix,

    I am just following up to share an additional idea for a slightly different custom workaround you can do with Conditional Formatting to visually create a similar solution which allows users to edit the rows and to insert a 'like' in specific rows.

    -

    First, in the data tab of the column settings, we manually insert "Like" and in this example just as a demonstration, we insert the "Dislike" as well ( that is optionall, of course, if you don't need the 'dislike', you can just leave it as an empty by default and set "Like" as the second choice).

    3964843839.png

    Make a Conditional Formatting in a String Column like this :

    If the user chooses "Like", then transform the content of that cell to HTML thumbs up symbol as :

    👍

    Or, if they choose "Dislike", set it to 

    👎
    4751582615.png

    Optionally, you can also allow inline Editing, so the user can just quickly double-click in the cell and choose empty, like or dislike choices for the value of each row.

    7965568543.png
    3915163901.png
    8685926149.png

    That idea and the one I sent before are the only two custom workarounds we have at the moment, as a 'temporary workaround' for the time being.

    I hope that helps.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