Finsweet CMS Filter loading slowly

I have created a page with a bunch of CMS items that is filtered using the CMS Filter.

https://community.femarelle.dk/artikler

When I load the page it seems like the items loads – and then loads again. See how the items are there, when the page is loaded and then fade up again after a second or so:
– See screenrecording here: CleanShot 2024-03-31 at 18.36.16 · CleanShot Cloud

The issue gets worse, when I try to load a query-URL by clicking one of the filter-buttons below an item/card, because the page with the filter applied doesn’t load instantly:
– See screenrecording here: CleanShot 2024-03-31 at 18.30.06 · CleanShot Cloud

I don’t have any interactions on my elements on the page, so I guess it’s the script that loads slowly – or what…?

Any idea how to fix this?

I can’t share the Read-only as I don’t have permission to share it somehow.

Hey @mail2! Normally content loading twice is caused by a repeated script somewhere on the page, however, I do not see any duplicates on your site.

I do notice that the “Alle” button is being selected even when loading the page and doing nothing. This could be triggering the content flash as it is basically filtering the list for that category after it is done loading.

I do not spot any script that targets and clicks this button but there should be something that is triggering this.

Can you check the setup and let me know?

Hi Luis,

It’s correct that the “All”-button gets selected when the page loads. That’s because I’ve added a hidden “Alle”-textfield in the Collections Item that are in the filtered list, thus loading all-items when that tag (“Alle”) is clicked in the filters (see image).

The reason why I did it this way is, that I – like many other, I’ve read – struggle with figuring out the documentation for the “All”-button.

I simply can’t get the “All”-button to be styled as selected when no other filter is clicked.

Can you help me with figuring that out, so I can abandon this hacky method I’m using for this?

@Support-Luis

Any help on the “All”-button would be appreciated :slight_smile:

Hey @mail2! Sure, I can help with that! And don’t worry, we are rebuilding these solutions. The process will be better explained in the new docs.

I made this guide some time back, it seemed to work great. Please try following it and let me know if you face any issues.

Hello again @Support-Luis

Seems like we have two issues going on here:

First issue

I removed my hack to get the “All”-button working.

But there still is a delay on the loading of new Collection Items after I click a certain Tag.
Screencapture: CleanShot 2024-04-04 at 15.25.59 · CleanShot Cloud

Second issue:

I’ve tried implementing the “All”-button using your method with no luck.

But for now that is a secondary issue. Right now, the main issue is the slow load times of the filtered items. Do you have any idea how this could be fixed?

The dealy is from the click on the item’s tag. We are reloading the page completely to re-filter the list using the query parameters.

I don’t recommend this setup as new searches from within the list will reload the page, which may load slowly for each filter depending on the user connection.

However, if you want to keep this functionality consider adding CMS Load so that the items are stored by default in the user’s cache.

Another option would be to add custom JS so that a click on a tag inside a card clicks the corresponding filter rather than completely reloading the page.