We would like to create a table that can be displayed differently on the page. Depending on what the shortcode defines to display. For example, the shortcode should only display columns 1 and 2 up to row 100:
[wpdatatable id=1 row="1,2" line="1-100"]
Is something like this possible? Unfortunately I have not found any instructions in the documentation. Can we use the shortcode to define specific rows and columns?
It will not be possible to 'limit a number of rows', for example, if you set some filter in a Shortcode, it is going to return all the rows which 'match' this filtered result.
But if you simply wish to learn ways how you can predefine filters to present differently filtered data from the same source wpDataTable, just different on different Pages; we will show some examples.
There can be different ways to pre-filter tables in our plugin :
SELECT * FROM yourDatabaseTable
WHERE columnName = '%VAR1%'
%VAR1% can be defined in the Placeholders tab when you're creating a table,
or you can pass a different VAR1 value in the table's shortcode.
-
2. Or, if you don't add the condition in an SQL query ( or don't use an SQL Table),
you can add %VAR1% in column settings -> Filtering, under "Predefined filtering value".
Then, you can have different versions of the same table, with the VAR1 value passed in the shortcode,
let's say if we had a "Regions" column and we wish to filter a different region per each page.
If we want page 1 for example only filtered for "Region A" , you can set predefined filter to this column as %VAR1% (filter type has to be set as text) :
Then for a page where we need only Region 1 filtered, use shortcode [wpdatatable id=1 var1='Region A'] ,
page 2 for only "Region B", shortcode would be [wpdatatable id=1 var1='Region B'] and so on,
to apply the values defined in the shortcode to the filter.
( This filtering method can be used for any table type, besides Simple Tables)
Let me know if that helps to achieve your use-case;
and if you have any additional questions.
2. We also have a Single Cell Shortcode Feature, which you can use if you need to just pull one cell value and present it anywhere on your Site.
And i just wanted to point out that you can try wpDataTables before purchasing
on our sandbox Demo sites ( you can find links for the main plugin Demo,
as well as add-on Demos, in my signature),
and there is a 15-day money-back guarantee period,
so if you purchase the plugin, you can safely fully test it out, and if it doesn't fit your needs you can request and receive a refund in that period. ( same goes for all plugins and add-ons)
Hello,
We would like to create a table that can be displayed differently on the page. Depending on what the shortcode defines to display. For example, the shortcode should only display columns 1 and 2 up to row 100:
[wpdatatable id=1 row="1,2" line="1-100"]
Is something like this possible? Unfortunately I have not found any instructions in the documentation. Can we use the shortcode to define specific rows and columns?
Regards
Hi Sven,
It will not be possible to 'limit a number of rows', for example, if you set some filter in a Shortcode, it is going to return all the rows which 'match' this filtered result.
But if you simply wish to learn ways how you can predefine filters to present differently filtered data from the same source wpDataTable, just different on different Pages; we will show some examples.
There can be different ways to pre-filter tables in our plugin :
If you wish to try Pre-filtering tables through URL, please check out this page with examples.
-
You can also use placeholders for table generation.
1. For example, if you have a MySQL query-based table, you can use this query:
%VAR1% can be defined in the Placeholders tab when you're creating a table,
or you can pass a different VAR1 value in the table's shortcode.
-
2. Or, if you don't add the condition in an SQL query ( or don't use an SQL Table),
you can add %VAR1% in column settings -> Filtering, under "Predefined filtering value".
Then, you can have different versions of the same table, with the VAR1 value passed in the shortcode,
let's say if we had a "Regions" column and we wish to filter a different region per each page.
If we want page 1 for example only filtered for "Region A" , you can set predefined filter to this column as %VAR1% (filter type has to be set as text) :
Then for a page where we need only Region 1 filtered, use shortcode [wpdatatable id=1 var1='Region A'] ,
page 2 for only "Region B", shortcode would be [wpdatatable id=1 var1='Region B'] and so on,
to apply the values defined in the shortcode to the filter.
( This filtering method can be used for any table type, besides Simple Tables)
Let me know if that helps to achieve your use-case;
and if you have any additional questions.
2. We also have a Single Cell Shortcode Feature, which you can use if you need to just pull one cell value and present it anywhere on your Site.
Please check more on this here.
And i just wanted to point out that you can try wpDataTables before purchasing
on our sandbox Demo sites ( you can find links for the main plugin Demo,
as well as add-on Demos, in my signature),
and there is a 15-day money-back guarantee period,
so if you purchase the plugin, you can safely fully test it out, and if it doesn't fit your needs you can request and receive a refund in that period. ( same goes for all plugins and add-ons)
Let me know if you have any additional questions.
Kind Regards,
Miloš Jovanović
[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