Hi guys, I'm trying to put together a page with a bunch of data taken from the datatable but only the cell specific shortcode (eg [wpdatatable_sum table_id=13 col_id=229 value_only=1]) - However I need to programmatically change the variable used in the SQL query (its currently set with %VAR1%. I understand I can set it with the standard shortcode - but this page only uses the sum shortcodes, and the table itself is never loaded. So it always loads the data with the preset placehoder I set in the table config.
Ive tried adding it to the shortcode - but it doesn't seem to do anything.
Failing that - is there a way I can tell it using php in my functions.php etc to use a specific variable that will also update the sum shortcodes too?
- If i understood, when you just place the SUM shortcode on the page, it does not follow the filtering you did on the source table with the VAR, right?
-
There might be a solution ( if i understood the issue correctly).
You can add the table's shortcode on the same page where you have the SUM shortcode,
this way the SUM is going to follow the table's filtering when they're on the same page.
- You can also hide the table completely with CSS, this way you will get the "follow table filtering" result on the SUM shortcode, without having the "table visually" on the page.
Let me know if that might work as a solution,
and i can devise some basic CSS for you if you wish to hide the table, i would just need the URL of the page with the table.
thanks for the reply...I actually managed to figure it out myself in the end..
I used the wpdatatables_before_get_table_metadata action and used some example code I found to set the variables prior to the table loading which meant that the sum shortcodes are updated in advance and show the data needed.
I am delighted to hear that this has been resolved. Thank you for letting us know. I will also make note of this , perhaps it might be useful for a future improvement by our devs.
Anything else that we could assist with, please don't hesitate to create new tickets.
Hi guys, I'm trying to put together a page with a bunch of data taken from the datatable but only the cell specific shortcode (eg [wpdatatable_sum table_id=13 col_id=229 value_only=1]) - However I need to programmatically change the variable used in the SQL query (its currently set with %VAR1%. I understand I can set it with the standard shortcode - but this page only uses the sum shortcodes, and the table itself is never loaded. So it always loads the data with the preset placehoder I set in the table config.
Ive tried adding it to the shortcode - but it doesn't seem to do anything.
Failing that - is there a way I can tell it using php in my functions.php etc to use a specific variable that will also update the sum shortcodes too?
Many thanks
Hi, Ben
Sorry for the delay
- If i understood, when you just place the SUM shortcode on the page, it does not follow the filtering you did on the source table with the VAR, right?
-
There might be a solution ( if i understood the issue correctly).
You can add the table's shortcode on the same page where you have the SUM shortcode,
this way the SUM is going to follow the table's filtering when they're on the same page.
- You can also hide the table completely with CSS, this way you will get the "follow table filtering" result on the SUM shortcode, without having the "table visually" on the page.
Let me know if that might work as a solution,
and i can devise some basic CSS for you if you wish to hide the table, i would just need the URL of the page with the table.
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
Hiya Milos,
thanks for the reply...I actually managed to figure it out myself in the end..
I used the wpdatatables_before_get_table_metadata action and used some example code I found to set the variables prior to the table loading which meant that the sum shortcodes are updated in advance and show the data needed.
Thanks
Hi, Ben
I am delighted to hear that this has been resolved. Thank you for letting us know. I will also make note of this , perhaps it might be useful for a future improvement by our devs.
Anything else that we could assist with, please don't hesitate to create new tickets.
Have a great day!
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