WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Limit filter keyword search to single column (10 posts)

  1. DavidBrugge
    Member
    Posted 6 months ago #

    I'm using TablePress 1.1.1,
    with Row Filtering 1.2, and Filter from $_GET 1.0.

    Is there an easy way, either through shortcode or through code modification, to limit the keyword search to the first column?

    Thanks

    http://wordpress.org/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 6 months ago #

    Hi,

    thanks for the question.

    Yes, this is possible by adding the filter_columns parameter to the Shortcode, like

    [table_filter id=123 filter_columns="1" /]

    Regards,
    Tobias

  3. DavidBrugge
    Member
    Posted 6 months ago #

    Humm,

    Perhaps I'm not understanding how the filter_columns parameter works.

    I have a three column table. I want to search a name and have the results show only the rows where the name matches column 1.

    I have the shortcode[table_filter id=4 filter_columns="1" /] but when I enter names into the search box, I still get results from columns 2 and 3.

    Am I implementing it wrong, or do I have a misunderstanding of the filter?

    Thanks

  4. TobiasBg
    Member
    Plugin Author

    Posted 6 months ago #

    Hi,

    ah, ok. So you are refering to the search field directly above the table (the JS search). That's totally unrelated to the Extensions that you are using, that's why I might have been confused here.

    Could you maybe explain in more detail what you are trying to achieve, maybe with a link to the page with the table?

    Regards,
    Tobias

  5. DavidBrugge
    Member
    Posted 6 months ago #

    Sorry, didn't know that they were not connected.

    Assuming that they were, I was testing from the search box on page.

    Here's the set up. This is for a church. It has Elders who are responsible for a dozen or so individuals and families. The assignments have been totally reworked and I want a way for members to go to the sight and find who their Elder is.

    I have page on with a search form for visitors to enter their name. The form directs to a page with the table. I want the form to filter out for just the family name. This part works fine.

    Members names in column 1, Assigned Elder in column 2, contact link in column 3.

    But when the name is the same as one of the Elders, everyone of the names assigned to the Elder appears. For instance, if Mrs. Jones enters her name and there is an Elder named Jones, then the table shows two pages of names.

    Not a big problem all in all, but not the elegant solution I want.

    http://trinitymemphis.org/?page_id=5286

  6. TobiasBg
    Member
    Plugin Author

    Posted 6 months ago #

    Hi,

    thanks for the explanation!

    For this, the suggested Shortcode parameter above is actually the correct solution, as you are using the two Extensions for this functionality (you are also using the JS based Search field above the table, but that's independent here).

    So,

    [table_filter id=4 filter_columns=1 /]

    does not bring the desired behavior?

    Regards,
    Tobias

  7. DavidBrugge
    Member
    Posted 6 months ago #

    Ah ha!

    The first examples had the numeral 1 within quotes.

    Now it works like a charm.

    Thanks ever so much!

    David

    If, others should come upon this post with the same question, how would one filter multiple columns?

  8. TobiasBg
    Member
    Plugin Author

    Posted 6 months ago #

    Hi,

    Great to hear that this works now :-)
    That with the quotes is weird though, as the quotes should not matter at all...

    If you want to filter multiple columns, you can pass a comma-separated list, or an hyphen-delimited range, or both, like

    [table_filter id=4 filter_columns=1-5,7-9,11 /]

    Best wishes,
    Tobias

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

  9. DavidBrugge
    Member
    Posted 6 months ago #

    I have rated it and recommended it highly to my WP users group.
    I can see why your ratings are so high.

    Next paycheck, I owe you a baseball book.

  10. TobiasBg
    Member
    Plugin Author

    Posted 6 months ago #

    Hi,

    thank you very much, I really appreciate that! :-) Great to hear that you like the plugin so much!

    Best wishes,
    Tobias

Reply

You must log in to post.

About this Plugin

About this Topic