WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Only visible by search (8 posts)

  1. sansibario
    Member
    Posted 1 year ago #

    Hi,
    is it possible to hide the complete table except the first row, and make the rest only visible by search?

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

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    thanks for your question.

    Unfortunately, I'm not aware of a solution for this, sorry.
    This might be possible with some custom code for the DataTables JS library, but unfortunately I can't help with that :-(

    Regards,
    Tobias

  3. sansibario
    Member
    Posted 1 year ago #

    Thanks anyway.
    Regards

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    sure, no problem. You are very welcome!

    Best wishes,
    Tobias

  5. sansibario
    Member
    Posted 1 year ago #

    you know, something like this would have been great:

    [table id=1 filter="%s" /]
    or
    [table id=1 hide_rows=all show=%s /]

    maybe it is possible in future versions.
    Anyway keep up the great work
    Regards
    Ramin

  6. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    well, this is possible. Please take a look at the filtering extension at http://tablepress.org/extensions/row-filter/
    It's just a little bit tough to get the search term in there from a form field. The best approach might be to use a page template, and instead of the Shortcode, use the Template Tag Function, which gets the filter word as a parameter.

    Regards,
    Tobias

  7. sansibario
    Member
    Posted 1 year ago #

    Hi Tobias,
    Template Tag Function? Can you give me an example how that would look like for the standard template Twenty Eleven?
    Regards
    Ramin

  8. TobiasBg
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    the Template Tag function is PHP code for usage directly in a template that is equivalent to a Shortcode in the regular post content.
    For example, the Shortcode

    [table id=1 filter="my_filter_word" /]

    could be written as

    <?php
      tablepress_print_table( array(
        'id' => 1,
        'filter' => 'my_filter_word'
      ) );
    ?>

    in a page template (see http://codex.wordpress.org/Pages#Page_Templates ). The advantage here is that you can use a variable (e.g. something that was submitted via the search form) for the 'filter' argument, which is not possible with the Shortcode.

    Regards,
    Tobias

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic