Order of CMS items - help?

One of the dynamic lists I added on a page is limited to just 1 item and the appearance is not fixed even though the order was already sorted out as Newest to Oldest and NOT random order. I’m wondering if the reason for the constant change is because the articles it’s changing to are under the same dates

Just sharing some screenshot:

This is the version on Webflow:
Imgur

This is the version when it’s published:
Imgur

And for some reason, after constant refresh it became this:
Imgur

Without changing anything else but the sort filter (to add the newest to oldest date), this showed up temporarily:
Imgur

I can only assume it’s the dates that’s causing the problem but I don’t understand why it would show different things since we’re not asking for it to show randomly.

Read-only website here, within the “Blog” page
https://preview.webflow.com/preview/collectivecampus?preview=2cb386da232fd52113f4041345abc8de

ping @Brando another thing related to dates and sorting, I know it’s your favorite thing :wink:

@nabbiechan I guess that as the dates are the same and they don’t have a time attached to them, there’s no real way for the CMS to get a consistent result on the sorting.

You can also sort on Date created, Date modified and Date published. I have the feeling that those dates always have a time attached to them, and will provide a more consistent sorting result if you decide to use them as a criteria.

Can you check if any of those are relevant for your needs, and try using them?

Hi @nabbiechan and @vincent

Thanks for posting and pinging me on this :slight_smile:

It looks like Vincent is on the right path here. I took a look at the blog posts in the screenshots you provided. It looks like they all have the same date set of 11/21/17 but the time field isn’t included.

With no way to differentiate between these dates, there are multiple posts that meet the filter/sort criteria and are displayed as a result.

There are a couple of solutions here:

  1. You can use the dates fields Vincent mentioned that are included by default such as date published and date created. This will ensure only one item matches the parameters set in your filter/sort settings
  2. You can add a switch field to the Blog collection to control which post is featured. Then you can set your filter for that Collection list to only show the featured post based on that switch.

Hope this helps clarify things!

And if the switch, let’s call it “Featured”, only serve that one purpose, you can combine two filters so you don’t have to go remove it from an item when you add it to another. Combine a switch filter with a date filter and only the most recent item with the switch on will display.

There’s another method which consist in using a numerical field. Use it like a switch, by entering a value when you want to feature an item. Start at 1 and go up from there. Use a sorting filter on that number so that the bigger value is the result of the filter. If you don’t want to have to remember what value you used last, use a value made with the current date. For example, if you write your date like YYYYMMDD, the last date is always the higher number.

I don’t really like any of those solutions, they’re still either request too much data handling or leave unnecessary data in the base.

Now there’s a solution for having your actual system work like you want it to. Activate the timestamp on your date fields. You don’t need to add data there, when you’ll add an item, Webflow will add the current time. So the last item will always have a “higher” date than the previous, hence your filter result being correct.

2 Likes

Thanks for the response guys!

Actually, we can’t use date published and date created because there were a few articles that we migrated at a later stage from our old website. So the best solution really is to just activate the timestamp.

If we do this, What about the existing items? Will it automatically create the time or do we have to go through the 300 entries and resave it?

I’m afraid that’s only a good solution for the items you’ll enter from no on, providing you can now activate the timestamp… I’m not sure what will happen to all your dates without timestamp if WF CMS allows you to add that characteristic to the field.

This is putting in light something quite important in term of workflow with Webflow CMS: the importance of nailing the content model before doing anything else. (anything else being graphic design mostly, and any task that prevents you to delete your dynamic content to reimport it after making changes to the data structure (fields in collections).

A very good practice is to import all data, create all pages with navigation, then place all collections lists in pages, populate collection templates/pages etc. Once everything works, the sortings, the conditional visibilities, the filters, once you’re sure the volume of data is fine for publishing, you can go on. You can see this as working with WF limitations, but it’s also a very healthy practice.

Very important lesson indeed. Possibly a potential Webflow video for those who are starting out?
Since managing the website was more of a handover to me, the following discoveries became a major obstacle course since there was no system or a strong foundation made for it and all I’ve been doing is to add band-aid. Hopefully, this changes once the website refresh commences.

Oh and btw, it generated a time-stamp automatically on existing entries. Thought I should let you know. For some reason, majority of the items were generated at XX:00 (very few had a different time)

Good idea but that demands planning ahead :smiley:

That’s another lesson you learn quick: even if Webflow eases the pain, there’s nothing like a site you’ve made yourself. It’s hard maintaining others work, it’s even hard starting with a template if you want to build many things. An advice can be rebuild element after element, to make them your own, page after page. No need to necessarily wait for a complete overhaul.

Can you be super specific about this? I assumed the time added would have been the exact time it was when you did the change. Can you tell me what was aded and what time it was when you made the change? :slight_smile:

The time-stamps are different times but will always have the 00:00 format (like 12:00 AM, 1:00PM). I’m assuming that this collection used to have a time-stamp because there were a few posts that had the exact time (11:46 AM, 4:16 PM from 2 years ago)

Unfortunately i don’t remember the time I made the change, it definitely was somewhere between 11:15 - 11:30 AM.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.