• Resolved ivanrm

    (@ivanrm)


    I am trying to filter my tablepress table before displaying in my blog. I would like to be able to filter the table according to a value passed in the url before displaying it and then allow searching etc.. with the displayed values. If anyone can point me in the right direction to achieve this I would really appreciate it, thanks!

    https://www.ads-software.com/plugins/tablepress/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Yes, this is possible with two TablePress Extensions. You could use the Extension from https://tablepress.org/extensions/shortcode-filter-get-parameter/ on top of the Auto Filter Extension from https://tablepress.org/extensions/datatables-auto-filter/

    That will filter using the DataTables JS library. To combine that with the “Shortcode Filter from GET parameter” Extension, you’ll need to change the line

    $attributes['filter'] = $filter_term;

    to

    $attributes['datatables_auto_filter'] = $filter_term;

    in the file tablepress-shortcode-filter-get-parameter.php.

    (You could also use server-side pre-filtering (so that the user can’t remove the filter word) by using the Extension from https://tablepress.org/extensions/row-filter/ instead, for which you then also don’t need that PHP code change.)

    Regards,
    Tobias

    Thread Starter ivanrm

    (@ivanrm)

    Awesome! Thanks so much for the quick and concise response.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

    Thread Starter ivanrm

    (@ivanrm)

    Hey one more quick question, I am trying to pass the value in the url for backend filtering. I have installed and activated the shortcode url and the row filtering plugins and I am trying to use them together and they aren’t working. I was able to just use the row filter separate but it seems using the two together has broken something. Sorry If I’m bothering ya. Thanks.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    did you change the Shortcode on the page with the table to that [table-filter id=123 /] Shortcode, and are all Extensions activated?

    Regards,
    Tobias

    Thread Starter ivanrm

    (@ivanrm)

    Hey,

    Yea, everything is installed and activated. I have it as [table_filter id=4 /] on my page with the underscore because that’s how it is on the site, I tried it with a – and it just output [table-filter id=4 /] onto the page. Other than that it’s just not filtering. I have another parameter plugin installed, think that could be the issue?

    Thread Starter ivanrm

    (@ivanrm)

    I just disabled the other plugin and it still didn’t work.

    Thread Starter ivanrm

    (@ivanrm)

    Haha, I figured it out! I changed that line of code trying the other way before I used the second choice (which Im using) and forgot to change it back. Working perfect! Five stars man, thanks for the plugin. As soon as I am able I’ll contribute some $.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    great! ?? Good to hear that everything is working now!
    And thanks for wanting to donate, I really appreciate it!

    Best wishes,
    Tobias

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Filtering Tablepress before displaying’ is closed to new replies.