• Resolved NicoleQ

    (@nicoleq)


    I have recently installed TablePress and I am loving how it is displaying my data.

    I wanted to know if there was a way to add a search field on another page (ex: Home Page) and have it pass this input data to the page with my table setup?

    AND (separate question) – can I have multiple tables and only one search input that goes through all of them? Or are the search fields table specific?

    https://wordpress.org/plugins/tablepress/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    For the first question, you could take a look at these suggestions:
    https://wordpress.org/support/topic/search-from-another-page?replies=8
    https://wordpress.org/support/topic/search-box-on-an-other-page-1?replies=5
    https://wordpress.org/support/topic/tablepess-search-box-on-homepage?replies=9

    Regarding the second question: Yes, search fields are table-specific, so that it’s not directly possible (that is without custom JS code that uses the API functions of the DataTables JS library) to have one field for multiple tables.

    Regards,
    Tobias

    Thread Starter NicoleQ

    (@nicoleq)

    Thank you for the links – they solved exactly what I was looking for.

    Additional Question: Is it possible to clear the search that was passed so that the visitor can use the search box on this page? OR is it better to hide this search box, then direct them to a new page?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

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

    I’m not aware of clearing that search field directly, sorry 🙁

    Regards,
    Tobias

    Thread Starter NicoleQ

    (@nicoleq)

    Would there be a way to remove the search box from the filtered table? So that users can’t see it (but it is still visible on the main un-filtered table)?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks!
    I might have an idea.

    Regards,
    Tobias

    Thread Starter NicoleQ

    (@nicoleq)

    Test site is setup here: http://resequip.staging.haxxess.com/parts-search

    I added a button “view entire parts list” to bring the user back to the entire (un-filtered) table.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks!
    On idea would be to not use the TablePress Row Filtering Extension for the filtering, but the TablePress Extension from https://tablepress.org/extensions/datatables-auto-filter/ (which basically uses the search field directly above the table).

    To use that together with the search from on the home page, you’d just have to modify the tablepress-shortcode-filter-get-parameter.php file and replace the line

    $attributes['filter'] = $filter_term;

    with

    $attributes['datatables_auto_filter'] = $filter_term;

    To then clear the filtering, the user would just have to empty the search field.

    Regards,
    Tobias

    Thread Starter NicoleQ

    (@nicoleq)

    That php code change works perfectly but I did NOT have to change the table short code to [table id=123 datatables_auto_filter=”word” /]

    because it worked just as well for the plain [table_filter id=123 /] shortcode

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    correct, the change of the Shortcode is not necessary, as that part is being done by the other Extension. Sorry for forgetting to mention that.

    Best wishes,
    Tobias

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Using Search Functionality on Other Page’ is closed to new replies.