On www.timef1.com/calendar you will see that the 3rd column (Ship's Name) shows the names of several cruise ships, and they are clickable. When you click on one of them, a page with more information from that ship is opened, like Length, Crew, Gross Tonnage, Speed, etc... (most of the ships don't have any info so at first I thought none of them had anything, but it turns out there are a few ships which do have some info)
So, the customer wants to keep this functionality, so that if a ship's name is clicked on the table we uploaded with wpDataTable, they are taken to another page showing them the ship's info.
Is this possible with wpDataTables?
I have all the data on an Excel sheet which I am attaching here in case it's useful.
What I would like is to present the information for a given ship (say the "Zaandam") when someone clicks on the FIRST table (the table with the calendar of the cruises) in a single page (could be a popup):
Ship name: Zaandam Operator: Holland America Line Length: 237m Speed: 23 knots Crew: 615 Tonnage: 61,396 GT Drugth: 8.1m Capacity: 1432 Etc, etc
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.
-
Yes. You can achieve this with our Master-Details premium Add-on.
It can be used if you wish to first present an initial table with less data/ less columns;
then if a user makes an action you set up, it can load "more details" only for the selected row
(1. If the “Row click” is selected, users will be able to access details for a row by clicking on it.
2. If the “Button click” is selected, a new column will be added to the table, where each row would get a button opening the details for it.)
-
You an also set up in which way you wish the details to load;
1. It can be as a Pop Up to reveal more columns of that row
2. A template Post with placeholders
3. Or a template custom Wordpress Page with placeholders to load data for more columns of that row.
Hello Milos, thank you I think that is exactly what we need. I will give this info to my customer. It seems though that all the information has to be on the same row right (it can't be on another table)?
Yes - If you wish to just try with the 'out of the box' Features, then this functionality only works for the same Table, when you hide some Columns in the 'more details' section;
then if a User clicks in a Row - more fields load for that row, from the same Table.
But there can be a custom workaround if you wish to make two tables, like "Master-Child relation with Master Details."
First, you need to create that button (master-detail) column in your existing table with Master-Detail add-on and then set a custom page (post) where users will be redirected after clicking on the button.
Then, on that custom page, you will insert a table created with an SQL query and using placeholders.
If you have that table in the database then you will use it for creating a new table with an SQL query and placeholders.
If you create a manual table then you will use the table that is created in the database (you can find its name in the Editing tab under "MySQL name table for editing").
Those database tables have names like wp_wpdatatable_1,wp_wpdatatable_2... (where wp_ is the default prefix of the database table, but on your end, it could be anything, so look for your_prefix_wpdatatable_1...).
Then, use that table's database name to create a new one with a query.
So you will create a new table like this
SELECT * FROM table_name_from_mysql_name_option WHERE column_name = %VAR1%
Then on that custom page, you would insert some default column_name value in shortcode like
[wpdatatable id=1 var1=test]
Now hooks. You will add this hook in your functions.php of your child theme or theme, depends on what you are using, to filter this var1.
And then you will use our hook for dynamically updating placeholders:
function updateVAR1($tableID){ global $wdtVar1;
// check is set details data from POST, where you'll find all row data
// from MasterDetail after button click in first table
if(isset($_POST['wdt_details_data'])){
$detailsData= json_decode(stripslashes($_POST['wdt_details_data']), true);
// instead of origin_header you will insert value from your column origin header
// on Master-dettails docs you will find Instructions how to create custom
// template (post or page) and below that is shown what is origin header
$wdtVar1 = $detailsData['origin_header'];
}
}
add_action('wpdatatables_before_get_table_metadata', 'updateVAR1');
This is the only way because the shortcode is executed before the content on the page or post.
Like this when the user clicks on the More details button (that you will create with Master-Detail) it will be redirected to your custom page (that you set in MD).
On that page, you will insert the shortcode of the Child table created from the query and placeholder.
After loading the page, the column value will be replaced with a placeholder, placeholders will be replaced in the query and you will get a table that is filtered with that placeholder.
I hope that I haven't confused you with this, but I try to be as detailed as I can so you can understand what and how you can achieve with this.
Hello Milos,
I hope you can help me with this one:
On www.timef1.com/calendar you will see that the 3rd column (Ship's Name) shows the names of several cruise ships, and they are clickable. When you click on one of them, a page with more information from that ship is opened, like Length, Crew, Gross Tonnage, Speed, etc... (most of the ships don't have any info so at first I thought none of them had anything, but it turns out there are a few ships which do have some info)
So, the customer wants to keep this functionality, so that if a ship's name is clicked on the table we uploaded with wpDataTable, they are taken to another page showing them the ship's info.
Is this possible with wpDataTables?
I have all the data on an Excel sheet which I am attaching here in case it's useful.
Attached files: ships.xlsx
I have created a table with the ships with wpDataTables here:
https://transoceanicas.com/cruise-shipping/ships/
What I would like is to present the information for a given ship (say the "Zaandam") when someone clicks on the FIRST table (the table with the calendar of the cruises) in a single page (could be a popup):
Ship name: Zaandam
Operator: Holland America Line
Length: 237m
Speed: 23 knots
Crew: 615
Tonnage: 61,396 GT
Drugth: 8.1m
Capacity: 1432
Etc, etc
Is this possible with wpDataTables?
Hi sven,
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.
-
Yes. You can achieve this with our Master-Details premium Add-on.
It can be used if you wish to first present an initial table with less data/ less columns;
then if a user makes an action you set up, it can load "more details" only for the selected row
(1. If the “Row click” is selected, users will be able to access details for a row by clicking on it.
2. If the “Button click” is selected, a new column will be added to the table, where each row would get a button opening the details for it.)
-
You an also set up in which way you wish the details to load;
1. It can be as a Pop Up to reveal more columns of that row
2. A template Post with placeholders
3. Or a template custom Wordpress Page with placeholders to load data for more columns of that row.
Please check more about Master Details here, with an example.
-
You can also test Master Detail Add-on features on this sandbox site.
Let me know how that seems,
or if you need something different entirely for your use-case?
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
Hello Milos, thank you I think that is exactly what we need. I will give this info to my customer. It seems though that all the information has to be on the same row right (it can't be on another table)?
Hi sven,
Yes - If you wish to just try with the 'out of the box' Features, then this functionality only works for the same Table, when you hide some Columns in the 'more details' section;
then if a User clicks in a Row - more fields load for that row, from the same Table.
But there can be a custom workaround if you wish to make two tables, like "Master-Child relation with Master Details."
First, you need to create that button (master-detail) column in your existing table with Master-Detail add-on and then set a custom page (post) where users will be redirected after clicking on the button.
Then, on that custom page, you will insert a table created with an SQL query and using placeholders.
If you have that table in the database then you will use it for creating a new table with an SQL query and placeholders.
If you create a manual table then you will use the table that is created in the database (you can find its name in the Editing tab under "MySQL name table for editing").
Those database tables have names like wp_wpdatatable_1,wp_wpdatatable_2... (where wp_ is the default prefix of the database table, but on your end, it could be anything, so look for your_prefix_wpdatatable_1...).
Then, use that table's database name to create a new one with a query.
So you will create a new table like this
Then on that custom page, you would insert some default column_name value in shortcode like
[wpdatatable id=1 var1=test]
Now hooks. You will add this hook in your functions.php of your child theme or theme, depends on what you are using, to filter this var1.
And then you will use our hook for dynamically updating placeholders:
This is the only way because the shortcode is executed before the content on the page or post.
Like this when the user clicks on the More details button (that you will create with Master-Detail) it will be redirected to your custom page (that you set in MD).
On that page, you will insert the shortcode of the Child table created from the query and placeholder.
After loading the page, the column value will be replaced with a placeholder, placeholders will be replaced in the query and you will get a table that is filtered with that placeholder.
I hope that I haven't confused you with this, but I try to be as detailed as I can so you can understand what and how you can achieve with this.
Let me know if this fits your needs.
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