I need that cells value in first column of my wpDataTable are defined like a link, so that when a user click on it, its integer underlined value is assigned to a placeholder, and this way, a new wpDataTable with all of specific details can be shown too.
How could I do this?
Attached I send you a file where you can see my wpDataTable,
I am not sure if i understood, if by a placeholder, you mean a link that will redirect the user, when they click on the cells of first column;
for example, if they click on "892" , it can redirect to a page with another table;
if that's the case, it can be done.
What you can do is, if you only need one link per each cell;
the easiest way will be to use our URL type column.
“URL link” columns are used to render hyperlinks that can be clicked to open pages within your website, or in external websites.
Rendering rules: If the content of the cells contains a combination of “two sticks” – || – everything to the left of this combination is used as an URL address for the link, and everything to the right as displayed text. For example: https://wpdatatables.com||Check out wpDataTables will be rendered as: Check out wpDataTables If the “||” combination is not found in the content, the entire content will be used both for the link and as the display value. For example: https://wpdatatables.com will be rendered as: https://wpdatatables.com
For a better explanation, I send you three files with forms which are rendered in my old app. In the file called 'main_table' you can see a table with all strategic/patterns codes, and if users click on one of these codes, a new table like in the file called 'secondary_table' must be rendered, in this second table is where details are. At this time, I have not created the second table yet, and I'am thinking that codes chosen from the main table are assigned to a placeholder (i.e. %VARIABLE1%) executing with it the shortcode associated to the second table. This second table extracts its data from a new MySQL view.
It also exits a graphic associated with the progress of the chosen strategic, wich extracts its data from a new different MySQL view, using the same placeholder value. You can see it in file called 'graphic'.
My idea is to render main_table, secondary_table and graphic in this order and one below the other on a web page, and each time users click on a new strategic code in main_table, secondary_table and graphic are refreshed according to the new chosen code.
I hope my explanation helps you to understand what I want to do.
Now, if using CONCAT after viewing the video is clear; here is an example that the devs advised;
you could make something like this form your table :
SELECT your_wpdatatable.`id`,
your_wpdatatable.`column1`,
your_wpdatatable.`column2`, CONCAT('',your_wpdatatable.`id`,'') FROM your_wpdatatable
-
These individual tables you can make with a placeholder, so that there is an ID value %var1% .
Then you can dynamically change var1 with this hook :
function updateVAR1($tableID){ global $wdtVar1;
//Replace with your table ID
if ($tableID == 1){
if(isset($_GET['id'])){
$wdtVar1 =(int)$_GET['id']; } } } add_action('wpdatatables_before_get_table_metadata', 'updateVAR1');
-
This way, anytime when a link in the concatenated table is clicked, it will go to the same page with a GET parameter of the clicked ID , and the second table will update var1 to that value.
I have already got the column values to work as a link with this CONCAT function:
SELECT CONCAT('<a href=/wp.wpdatatable_2>', A.COD_ESTR, '</a>') AS COD_ESTR,
But I have sintax problems with the hook that you have suggested, as you can see in the attached file I send you, and I don't quite understand how the 'id' parameter works in the function. Maybe you can clarify this point for me.
Thank you for this update, when the developers sent me this suggestion -
i think possibly they meant to add the hook to the functions.php of the theme, or child theme.
( At least i think so, that is where they usually advise me for users to place hooks - i should've asked them this additional detail, sorry about that),
and i can see that you tried to implement it directly in the plugin JS - i think it won't work that way.
But to be honest, i am not 100% sure - you can try to add the hook to the functions.php file and see if that works;
in the meantime i will get further advice from the developers - since using hooks is above my skill level.
As soon as they respond, we will report back once again.
I'll take over this ticket since Milos is on a vacation.
From what I can see, you added this to a file called "custom-functions.php", while it should be in "functions.php". This file should already exist in your theme's folders.
It's usually in the main folder, for example ..wp-content/themes/storefront/functions.php
I am going to use Divi Builder to build my website, and Divi is a theme itself, so the functions.php file must be under Divi theme. I am not completely sure if this custom-functions.php file will be the correct one or not, it is something I will have to consult with the support of my hosting at the time, but it is the only name that I have found with greater resemblance under the Divi theme.
At the moment, I am only interested in knowing if the parameters of the function are correctly assigned.
I have returned, and now Aleksandar is on vacation, but we will work as a Team, as always - to help you with any issues.
It seems to me that we got this one solved - but we will be here, please let us know if you have any additional questions regarding what we covered, or if you have a new question, please open a new ticket.
Up to this point, it's solved for me. For a later phase, I would check that the result of the hook links correctly with the placeholder variable, but if there were any problems regarding this, I would open a new ticket.
Hi TMS team,
Let me tell you:
I need that cells value in first column of my wpDataTable are defined like a link, so that when a user click on it, its integer underlined value is assigned to a placeholder, and this way, a new wpDataTable with all of specific details can be shown too.
How could I do this?
Attached I send you a file where you can see my wpDataTable,
Best regards
Francisco Gutiérrez
Hi, Francisco
Sorry for the delay
-
I am not sure if i understood, if by a placeholder, you mean a link that will redirect the user, when they click on the cells of first column;
for example, if they click on "892" , it can redirect to a page with another table;
if that's the case, it can be done.
What you can do is, if you only need one link per each cell;
the easiest way will be to use our URL type column.
“URL link” columns are used to render hyperlinks that can be clicked to open pages within your website, or in external websites.
https://wpdatatables.com||Check out wpDataTables
will be rendered as:
Check out wpDataTables
If the “||” combination is not found in the content, the entire content will be used both for the link and as the display value. For example:
https://wpdatatables.com
will be rendered as:
https://wpdatatables.com
Please check more details here how to make it and how it works.
Let us know if that is the solution that you need? 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
Hi, Francisco
Just wanted to add something.
In case i misunderstood; and if you wish to make something like an URL pre-filter;
to show the same table, but with filtered data - please check out our URL prefiltering here.
So, you can use URL column, and combine it with a URL prefilter, in each cell > and that can work, it will then lead to a prefiltered table result.
Let me know how all that seems > and if i still didn't understand your goal - please elaborate with more details.
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
Hi Milos,
For a better explanation, I send you three files with forms which are rendered in my old app. In the file called 'main_table' you can see a table with all strategic/patterns codes, and if users click on one of these codes, a new table like in the file called 'secondary_table' must be rendered, in this second table is where details are. At this time, I have not created the second table yet, and I'am thinking that codes chosen from the main table are assigned to a placeholder (i.e. %VARIABLE1%) executing with it the shortcode associated to the second table. This second table extracts its data from a new MySQL view.
It also exits a graphic associated with the progress of the chosen strategic, wich extracts its data from a new different MySQL view, using the same placeholder value. You can see it in file called 'graphic'.
My idea is to render main_table, secondary_table and graphic in this order and one below the other on a web page, and each time users click on a new strategic code in main_table, secondary_table and graphic are refreshed according to the new chosen code.
I hope my explanation helps you to understand what I want to do.
Best regards
Francisco Gutiérrez
Hi, Francisco
Thank you for further clarification, i believe we are getting closer to fully understand exactly what you need.
I will have to get help from senior colleagues from our 2nd level - we will go through all the details together,
and i will report back to advise you further on the matter.
Thank you for your patience - we will do our best to be as quickly as possible.
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
Hi, Francisco.
Sorry for such waiting time - the 2nd level Team will still advise me about this, i don't have the confirmation yet.
We will be as quick as possible to advise you.
Thank you for your patience.
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
Hi, Francisco.
I've been advised.
The closest we can get to the solution you need is by using a combination of CONCAT function, a placeholder, and a hook.
Here is an example video on how to use CONCAT with our plugin.
-
Now, if using CONCAT after viewing the video is clear; here is an example that the devs advised;
you could make something like this form your table :
-
These individual tables you can make with a placeholder, so that there is an ID value %var1% .
Then you can dynamically change var1 with this hook :
-
This way, anytime when a link in the concatenated table is clicked, it will go to the same page with a GET parameter of the clicked ID , and the second table will update var1 to that value.
-
Let us know if you have any questions. 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
Hi Miloš,
I have already got the column values to work as a link with this CONCAT function:
SELECT CONCAT('<a href=/wp.wpdatatable_2>', A.COD_ESTR, '</a>') AS COD_ESTR,
But I have sintax problems with the hook that you have suggested, as you can see in the attached file I send you, and I don't quite understand how the 'id' parameter works in the function. Maybe you can clarify this point for me.
Kind regards
Francisco
Hi, Francisco
Thank you for this update, when the developers sent me this suggestion -
i think possibly they meant to add the hook to the functions.php of the theme, or child theme.
( At least i think so, that is where they usually advise me for users to place hooks - i should've asked them this additional detail, sorry about that),
and i can see that you tried to implement it directly in the plugin JS - i think it won't work that way.
But to be honest, i am not 100% sure - you can try to add the hook to the functions.php file and see if that works;
in the meantime i will get further advice from the developers - since using hooks is above my skill level.
As soon as they respond, we will report back once again.
Thank you for your patience.
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
Hi, Francisco
My sincere apologies for the waiting time.
We have additional advise by the developers.
They confirm that the hook should go into the functions.php file of your active theme or child theme;
because this is PhP code, not a script.
Also, this part "$tableId == 2 " , the number 2 you should replcate with the ID of your table, we just wanted to point this detail out, to be sure.
Let us know how it goes. 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
Hi Miloš,
thank you for your info.
To be sure, I attach a file in case you can confirm if the parameters are set correctly.
Kind regards
Francisco Gutiérrez
Hey Francisco
I'll take over this ticket since Milos is on a vacation.
From what I can see, you added this to a file called "custom-functions.php", while it should be in "functions.php". This file should already exist in your theme's folders.
It's usually in the main folder, for example ..wp-content/themes/storefront/functions.php
This is an example for the StoreFront theme.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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
Hi Aleksandar,
I am going to use Divi Builder to build my website, and Divi is a theme itself, so the functions.php file must be under Divi theme. I am not completely sure if this custom-functions.php file will be the correct one or not, it is something I will have to consult with the support of my hosting at the time, but it is the only name that I have found with greater resemblance under the Divi theme.
At the moment, I am only interested in knowing if the parameters of the function are correctly assigned.
Kind regards
Francisco Gutiérrez
Hey Francisco
As far as I can see, they should be correct. As long as the table you're targeting is table #2, it should be OK.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
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
Hi Aleksandar.
thank you for confirming.
Kind Regards
Francisco Gutiérrez
Hi, Francisco
Sorry for the delayed answer.
I have returned, and now Aleksandar is on vacation, but we will work as a Team, as always - to help you with any issues.
It seems to me that we got this one solved - but we will be here, please let us know if you have any additional questions regarding what we covered, or if you have a new question, please open a new ticket.
All the best. 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
Hi Miloš,
Up to this point, it's solved for me. For a later phase, I would check that the result of the hook links correctly with the placeholder variable, but if there were any problems regarding this, I would open a new ticket.
Kind regards
Francisco Gutiérrez
Hi, Francisco
That sounds good.
We will be here, so don't hesitate to reach out to us, once you get to the later phase - if you notice any issues.
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