We're Moving to a New Support Platform – Starting June 1st!

We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.

You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.

While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.

We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.

Thanks for your continued support and trust – we’re excited to bring you an even better support experience!

Okay
  Public Ticket #2383402
Filter in Shortcode
Closed

Comments

  • Marcial Bollinger started the conversation

    Hi there

    I found out how to prefilter a table with URL parameters, e. g. 

    ?wdt_column_filter[1]=something

    We have a site where we want to show the same table mutliple times on the same page, but each time filtered by a different value. We have a table with hotels and prices. In the frontend we want to show a table per hotel with its own prices. 

    Is there an option to use the URL filters within the shortcode?

    If not, is there another option to achive a similar result?

    Thanks!

  • Ryan Vaughan replied

    Hi Marcial,

    I am not support but based on your question I would do that by using shortcodes and variables. 

    If you filter Hotels by %Var1% placeholder in the back end (make sure to set a default value for %Var1% before you save), you can then call the same table multiple times on the same page and change the shortcode to filter by different hotels.

    Example;

    [wpdatatable id="108" var1="Hotel Name 1"]

    [wpdatatable id="108" var1="Hotel Name 2"]

    [wpdatatable id="108" var1="Hotel Name 3"]

    I hope that helps,

    Ryan

  • Marcial Bollinger replied

    Hi Ryan

    Thanks a lot for providing an answer to my question. It looks like this would work great with a query. For now I planned to work with an excel sheet. But I don't see how I could define var1 as a filter condition. But I'm sure this must work, as the description states, that "filtering for tables created from XML, JSON, Excel, ..." will work with placeholders. 

    Do you by any chance know how to set this up?

    Thanks!

  • Marcial Bollinger replied

    Ah nice, I just found it. I realized that I have to assign the variable to a column. Thank you very much for your help!

  • Ryan Vaughan replied

    The solution should still work fine for an excel table...

    If you boot up the table in the backend, go to Placeholders at the top and where it says %VAR1%, add a name of one of your hotels. This is just a placeholder so dont worry too much about which hotel name you decide to you, just make sure it exists. 

    Once you have done that, go to Hotel Name column settings and in filtering, you can set the predefined value as %VAR1%. As you just setup a placeholder for %VAR1%, your table should filter to the placeholder you set above which is fine. 

    Save the table and go to your page and call the table as you usually would with a shortcode, just add the hotel name to the VAR1 bit. The table should load, filtering the hotel name by VAR1 which you have set in the shortcode. 

    Example

    [wpdatatable id="108" var1="Hotel Name 1"]



  • Ryan Vaughan replied

    You got there before I did :)

  • Marcial Bollinger replied

    Thanks, Ryan. Your answer is much more detailed than mine, so I'm sure it will help others find the correct solution too.

  •  2,576
    Aleksandar replied

    Hello Marcial, hello Ryan.

    It looks like you guys managed to get it to work before I got to the ticket.

    Thanks for your help, Ryan!

    Filtering the same table multiple times from URL is not possible, so I too would suggest using placeholders for this.

    Great work.

    If you have any further questions or issues, please feel free to open a new ticket, and we'll gladly help.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia 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