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

    (@tobiasbg)

    Hi,

    thanks for your question.

    You could probably achieve with two TablePress Extensions:
    The “Row Filter” Extension can be used to only show rows that contain a search word in a cell, see https://tablepress.org/extensions/row-filter/
    On top of that, there’s the Extension https://tablepress.org/extensions/shortcode-filter-get-parameter/ which allows to populate that search term from a GET parameter of the URL.
    With that, you could add a search form to your page, that sends a GET request with the search word to the page that will then contain the search results.

    Regards,
    Tobias

    Thread Starter [email protected]

    (@timabcwebservicecom)

    Hi thanks for your help. I added the extentions and have added a simple seerach form to a page. the code is below. When I search it just dies. Below is the code I am using. This is just a testing site. Am I even close to doing it correctly? I am try to match both a number and a name.
    Like 20 and Houston to return the row matching both items

    form action=”https://www.abcwebservice.net/wordpress/table-test/?” method=”get”>
    <p>
    <input type=”search” />
    number</p>
    <p>
    <input type=”search” name=”search” id=”search”>
    surname</p>
    <p>
    <input type=”submit” name=”submit” id=”submit” value=”Submit”>
    </p>
    </form>

    Table page
    https://www.abcwebservice.net/wordpress/table-test

    Search page
    https://www.abcwebservice.net/wordpress/search

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    that’s a great start already!
    We should start simply, with just one filter word. Having two filter words is actually not directly possible with the Extension, but would require PHP code changes.

    Please try again with this form:

    <form action="https://www.abcwebservice.net/wordpress/table-test/?" method="get">
    <input type="search" name="table_filter" id="search" />surname<br /
    <input type="submit" name="submit" id="submit" value="Submit">
    </form>

    Additionally, the page https://www.abcwebservice.net/wordpress/table-test/ should have a Shortcode like

    [table_filter id=123 /]

    and you need to have both of the Extensions from above installed and activated.

    Regards,
    Tobias

    Thread Starter [email protected]

    (@timabcwebservicecom)

    Thank you, I have added the form code you sent. Both plugins are installed and activated.

    The serch box is here with the form
    https://www.abcwebservice.net/wordpress/search/

    https://www.abcwebservice.net/wordpress/table-test/ has this short code [table_filter id=3 /] and displays the table

    but when I try a search i get

    Not Found
    Apologies, but the page you requested could not be found. Perhaps searching will help.

    Thanks
    Tim

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Tim,

    it’s almost working. There’ just some invisible characters in the URL.

    Please replace the line

    <form action="https://www.abcwebservice.net/wordpress/table-test/?" method="get">

    with this again (I know it looks the same, but it isn’t. There’s an invisible character right before the second "), with copy&paste:

    <form action="https://www.abcwebservice.net/wordpress/table-test/" method="get">

    Regards,
    Tobias

    Thread Starter [email protected]

    (@timabcwebservicecom)

    Perfect! Thank you. Ok you said Having two filter words is actually not directly possible with the Extension, but would require PHP code changes. How difficult would this be to do?

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    great to hear that this worked!

    The changes are not really complicated, but unfortunately, I’m a little bit busy at the moment. I might be able to make these changes this weekend. If you need them quicker, we could work something out professionally. If you are interested, please send me an email (the address is in the main plugin file “tablepress.php”).

    Regards,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Search from another page’ is closed to new replies.