Hey everyone!
With the holiday season upon us, we want to share our upcoming working hours:
- New Year: Our team will be off on January 1st and 2nd. We’ll be back on Friday, January 3rd, to respond to any messages received during this time.
- Weekend: As usual, we don’t work on weekends, so January 4th and 5th will also be non-working days.
- Orthodox Christmas: Our office will be closed on Monday and Tuesday, January 6th and 7th for the holiday.
After that, we’ll return to our regular schedule and assist you as quickly as possible.
In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find tons of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel), which might just have the answers you need while we’re away.
Thanks a bunch for your understanding and support!
Warm regards and happy holidays!
TMS
I am using wpDatatables to build views from sql db tables. That's working fine.
Now, for each retrieved row, I need also, to add 2 custom columns: the first with the URL links and the second with a button pointing to a wp page. While is possible to do with standard wpdatatables it seems that such feature is not available for data tables using sql. Is this true or i miss something? Can you please advices if there is a way to achieve so?
Thanks a lot.
P.S. I am novice to wpdatatables
Hi Daniele,
Firstly, I would like to sincerely apologize for the delayed response as we have been experiencing an unusually high number of tickets. I am sorry that it has taken longer than usual to respond to your concern and your patience is highly appreciated.
-
I am not sure if i fully understood your use-case.
It seems that you made an SQL VIEW in your Database and are calling the data from your VIEW in our SQL Query-based Table, and you succeeded in returning the data you need.
-
So now you wish to add two Custom Columns to an SQL Query-based Table?
Adding or removing Columns directly through our Plugin is only possible with our Manual Tables.
When you make a Manual Table, this creates a new stand-alone SQL Table in your Database, and you can add/remove Columns through our Plugin directly.
( You can also later call this same data through another SQL Table like, check under Editing Tab what's the MySQL Table name, and in a new SQL table just call it as : SELECT * FROM TableName)
But when you do an SQL Query based Table - this only 'pulls'/calls the existing data from your existing SQL Tables - it does not create a new Table in your Database, if that makes sense.
But it depends exactly what you mean by adding Custom Columns.
For example, you can try our new feature "Transform Value".
You can use this feature if you have some Columns which contain 'part of the value' you need for your URL link, and combine actual values from multiple Columns of your Data in the same cell.
Here is a basic example we made with a Manual Table.
A Table with some Products, the Product ID Column named as "id" along with Field "ProductName", etc;
For each Product, we made an individual Page, with URL as :
http://myWebsite/page-Product ID/
For Product ID 221 the full URL will be like :
http://localhost/current/page-221/
For a Custom Link, i will create a new Column, we will combine manually adding an "a href" HTML hyperlink and add a "target blank" attribute to open it in a new tab, as well as displayed link text.
For the URL, we added a blank String Column in this Table, and we will construct it with "Transform Value" Feature.
We create each cell to start with "<a href="http://localhost/current/page-" then add the value for the Product ID as column placeholder {id.value} and for the displayed link text we will combine adding the product name such as "Click here to view {productname.value} Page" , ending it with the closing </a> tag, like :
Of course, we can additionally add a CSS class to the HTML anchor Tag, such as :
Then we can call that class for custom styling and make the link look as a button in the Table's Customize/Custom CSS, and so on.
So, as long as we include some existing column placeholders with values, we can construct custom links, etc.
We will do our best to add more detailed examples to our Documentation and perhaps some new videos in general that can clarify the possibilities.
You can additionally check out more details explained how the "Transform Value" feature works on this Page ( if you haven't already).
2. Another way how you can make Custom Links with SQL Query based Tables is to use the SQL CONCAT function.
Please check our Video here where we show an example of that.
Let me know if one of these two methods achieves what you need, or if you need something different?
Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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