• Resolved danniee

    (@danniee)


    Hello again Tobias,

    I need some advice as to which approach is the best one here.

    I have created a column where I have added filter keywords because I need some items in the table to show up on specific pages.

    But I feel this is not optimal because on load, for about a second, all filters are displayed to the visitor which, quite frankly, looks awful.

    Another problem is that, with one main table, I cannot seem to change the position for the items on specific pages, so all ranks will be exactly the same on every page where I have the table. Is it possible to do something about this?

    Is there some other clever way of doing this? The only option I could think of would be to simply create one table for each page but it would be a pain to keep all tables up to date.

    Thank you

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    If you want to maintain one large table, but show smaller/reduced/filtered versions of it on different pages, you almost always want to use the TablePress Row Filter Extension from https://tablepress.org/extensions/row-filter/
    Could you try that?

    Unfortunately, I’m not sure what you mean with that “change the position for the items on specific pages” question ??

    Regards,
    Tobias

    Thread Starter danniee

    (@danniee)

    Hello Tobias,

    Thank you for your generous help and for taking the time.

    I do indeed use the row filter extension, but it’s causing the above effect, which is that ‘hidden’ filter words are displayed for a fraction of a second when the page loads which looks a bit unprofessional imo. I guess it’s because it takes some time until the proper code is loaded which hides the filter columns.

    What I mean by ‘changing the position of the items’ is that, for example on one page I want ITEM1 to have the top position, but on another page I want ITEM4 to have the top position. I hope this clears it up?

    Thank you

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    that would be strange. The Row Filter Extension definitely is not sending content to the browser so that that content can’t be visible, even just for a short time.
    Can you please post a link to the page with the table where this problem happens, so that I can take a direct look? Thanks! And what’s the exact Shortcode that you are using for the filtered tables?

    For the order, you could maybe also use https://tablepress.org/extensions/table-row-order/

    Regards,
    Tobias

    Thread Starter danniee

    (@danniee)

    For example, on one page I use this shortcode:

    [table id=1 datatables_counter_column=true filter=”item1″ /]

    I sent you a link to my site to your mail address ??

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for the Shortcode and the link! Now I see what you mean. This is caused by the filter words being hidden using a “Custom Command”. We can instead hide them on the server, so that they are not even sent to the browser.
    For that, please try this modified Shortcode:

    [table id=1 datatables_counter_column=true filter="item1" hide_columns="5" /]
    

    In addition, I suggest to replace the “Custom Command”

    "columnDefs": [ { "visible": false, "targets": [ 4 ] }, { "orderable": false, "targets": [ 0, 1, 2, 3, 4, 5, 6 ] } ]
    

    with this one:

    "dom": "lrtip"
    

    , and to turn on the search/fitler checkbox, but turn off the sorting checkbox.

    Regards,
    Tobias

    Thread Starter danniee

    (@danniee)

    I don’t even know what to say, this is amazing Tobias. This issue has been bugging me for so long. Thank you so much.

    Your work is incredible and I have donated to you on several occasions before and will keep doing so when I can.

    Anyone reading this, please consider donating to Tobias because his plugin is free and the support is excellent. Let’s support him!

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Filters, best approach?’ is closed to new replies.