• Resolved Matt

    (@mattfleaydaly)


    G’day There Mate,

    I’m not sure if this has been asked before but i’ll ask it anyway.

    Basically i have setup two blocks using table press on my homepage. They are being used to show upcoming events. Alongside them i have installed the ” TablePress Extension: Row Filtering based on date ” Plugin to hide events after their set date.

    I was wondering if there was anyway that i could also limit the widgets with the shortcode to only show 5 rows at once ( so once a row hides after it’s date another one shows to keep it at 5 showing )

    This is urgent and i appreciate the help in advanced mate ??

    https://www.ads-software.com/plugins/tablepress/

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

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The best solution that I see here would be to simply use the Pagination feature from the DataTables JS library’s features. With that, you could show 5 entries at a time, and your users would even be able to see the other entries with a few clicks.

    Regards,
    Tobias

    Thread Starter Matt

    (@mattfleaydaly)

    Thanks for the reply Tobias,

    Yeah i did try that one but i don’t want the users to be able to scroll to the next page, in other words i don’t want pagination i just want the x entries at a time if possible…

    I’m happy to edit the plugin core files if i need to, but if possible it would be great to gather some direction from you as the author.

    Thanks mate!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ok, in that case, we could use some CSS code to hide everything below the sixth row of the table (the table header also counts, if you are using that).
    So, please try this “Custom CSS” (with the correct table ID):

    .tablepress-id-123 tbody tr {
      display: none;
    }
    .tablepress-id-123 .row-2,
    .tablepress-id-123 .row-3,
    .tablepress-id-123 .row-4,
    .tablepress-id-123 .row-5,
    .tablepress-id-123 .row-6 {
      display: table-row;
    }

    Regards,
    Tobias

    Thread Starter Matt

    (@mattfleaydaly)

    Thanks so much for that Tobias,

    Works 110% ??

    Just a side note while it comes to mind,

    This would probably make things to complicated but would there also be a way to make a row automatically delete after the date in it has passed?

    If not thats alright mate ??

    Thanks so much again ??

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no, sorry, I don’t see am easy way to delete a row automatically. That would require extensive extra code.

    Best wishes,
    Tobias

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

    Thread Starter Matt

    (@mattfleaydaly)

    No worries mate,

    Already rated 5 stars ??

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks, I really appreciate it!

    Best wishes,
    Tobias

    Thread Starter Matt

    (@mattfleaydaly)

    G’day Again Tobias,

    I had another thought which was can i make a row show only if the other ones have passed their expiry date?

    In other words i was going to add a row that said in a column ( ” No Further Events For Now ” )… I am only wanting this to show if there are no more events left if you get what i mean.

    Thanks so much again!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I see what you mean, but unfortunately, I can’t think of a solution for this at the moment ?? You’d probably have to develop some custom code here, that e.g. hooks into the table output filter hooks and then adds that text as necessary.

    Regards,
    Tobias

    If you’re still looking for a solution to your last comment, I think I have one figured out.

    Between every event, insert 5 rows (or however many you have visible at a time not including your head/footer). Then in the 1st row include the “No Further Events” text and set the date of all 5 rows for the day before the next event. Then the “No Further Events” will show between the two event dates.

    Then, to hide the other 4 empty rows, use this extension: https://tablepress.org/download/extension/tablepress-cell-highlighting.zip (Tobias, not sure why I can’t find this on the Extensions page. It’s the most valuable in my arsenal.) Now include a keyword like keyword-empty in those 4 blank rows and add the CSS .keyword-empty {display:none;} Then write your table’s shortcode like this [table id=123 highlight=”keyword-empty” /]

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for sharing this! Hopefully it’s useful!

    The TablePress Cell Highlight Extension mainly does not yet have a page because I still want to polish it a bit ??

    Regards,
    Tobias

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Display X number of rows’ is closed to new replies.