Okay
  Public Ticket #3187999
wpDataTables
Closed

Comments

  • Lauren started the conversation

    We run a volleyball club and use Excel to list out all of the teams practice schedules and tournament schedules. We currently snip the filtered table and save it as an image for the individual teams. Would I be able to use the same table, but have the table pre-filtered on each team page for the corresponding team?

  •  1,701
    Miloš replied

    Hi, Lauren 

    Thanks for reaching out to us

    Yes. There can be different ways to achieve predefined filters for our tables, i will show you some examples.

    -

    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:

    SELECT * FROM yourDatabaseTable
    WHERE someColumn = %VAR1%

    %VAR1% can be defined in the Placeholders tab when you're creating a table, 

    then you can have multiple SQL Query-based tables that each have a different value filtered of that column.

    2. 

    Or, if you don't add the condition in an SQL query, 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.

    9385158392.png

    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) :

    4266306375.png

    Then for a page where we need only Region 1 filtered, use shortcode [wpdatatable id=1 var1='Region A'] ,

    4565461533.png
    6779925578.png

     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)

    -

    I also made a short video example - please check it out here.

    Let me know if you have any questions.smile.png

    Thank you

    Kind Regards, 

    Miloš Jovanović
    [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