• Resolved jfk105

    (@jfk105)


    Hi, I’m trying to make a sort of “Press Review” so I create a table where I can add columns for “Date”, “Article’s Title”, “Newspaper’s Name” and “Pdf download link”.
    Then I’m using “Row filtering by date” extension.
    The system works fine and the page shows only today’s articles.

    Now I would need to search among the articles of all dates and not only those of today but if I use the TODAY filter (which suits me for today’s viewing) the search is restricted only for today. How can I show only today’s articles but also be able to search on previous articles inserted into the table or for previous dates at the same time as if it were not filtered ??

    If I disable the filter obviously all previous and current articles are shown, which I don’t want.
    Thanks, bye
    J

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    For this, you would have to do the filtering on the frontend side, using JavaScript code.
    Unfortunately, I don’t have a readily usable solution for that. You could maybe start with the TablePress Extension from https://tablepress.org/extensions/datatables-auto-filter/

    Regards,
    Tobias

    Thread Starter jfk105

    (@jfk105)

    Hello, thank you very much for the answer
    I really don’t know how to work with javascript on frontend… ????

    With datatables_auto_filter extension instead:
    Basically I would need that the value of datatables_auto_filter was set to “today” or with a variable because if I insert the date manually it works fine but it should be a dynamic value and not “static” to force every day … It is not really feasible then?
    Thanks so much
    J

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    yes, that’s pretty much the way to go. One idea to achieve this would be to add the following code to the tablepress-datatables-auto-filter.php file of the Extension, directly after line 61, which is

    $auto_filter_word = preg_replace( '#[^0-9a-zA-Z\.% +-_]#', '', $js_options['datatables_auto_filter'] );
    

    :

    if ( 'today' === $auto_filter_word ) {
      $auto_filter_word = wp_date( 'm/d/Y' );
    }

    Regards,
    Tobias

    Thread Starter jfk105

    (@jfk105)

    Tobias, thank you very very much. It works like a charm!
    And adding “Row filtering” extension I can use the same table three times on the same pages to filter content beyond the date combine the extensions.
    Thanks for your wonderful plugin and job!
    Ciao, J

    Plugin Author TobiasBg

    (@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!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Row filtering by date and Search’ is closed to new replies.