Okay
  Public Ticket #3167102
Setting Predefined value(s) in filtering
Closed

Comments

  • Patrick started the conversation

    So I set a predefined value in filtering on this page of "adartistry" - and the page displays those results which is great. The problem is the user can delete "adartistry" and see all the other results. Can I set the filter so that it CANNOT be changed? We want this tables on private pages where only those submitters can see them and should not be able to see any other results.

    Thanks

  • Patrick replied

    tried this, same result:

    You can add a placeholder as a predefined filtering value to a column (in column settings). For example, you can add %VAR1% as a predefined filtering value. Then, change the shortcode to [wpdatatable id=1 var1=car] and the column that has %VAR1% as a predefined value will be filtered per “Car”.

  • Patrick replied

    Duh, never mind - just eliminate that column from being seen on front end

  •  2,572
    Aleksandar replied

    Hey Patrick

    Unfortunately, you can't set predefined values for filtering, and prevent users from seeing other values when they clear the predefined values.

    If I'm not mistaken, this is what you did: You created an SQL query-based table with a query similar to this:

    SELECT * FROM your_database_table
    WHERE filtered_column = %VAR1%

    Then, when you add the table to the page, you can use the shortcode (as mentioned in your previous response) to change the value for different pages.

    If that's what you need, then you only need to disable filtering for that column, and the table will be filtered by the data defined in the MySQL query + the placeholder.

    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