Unpublish collection item with expiry date

Hi.
I am working on a project and there’re a few requirements that i’m not sure if Webflow could achieve.

  1. Single hosting with multiple domains. Each domain with each webpage.
  2. Auto unpublish a collection item/page after expiry date.
  3. Redirect a page automatically after a certain duration.

Anyone able to assist?

Thanks.

1 Like
  1. a collection item can’t be “unpublished” but it can be filtered out of collection lists once its defined expiration date is passed, hence becoming unaccessible.

  2. custom code can address this in many ways.

Thanks for the reply.
May I know how to do point no.2?
I just can’t figure out how to achieve this. :thinking::thinking::thinking:

Sure,

First you need to add an Expiration date field, in the form of a date field.

http://vincent.polenordstudio.fr/snap/Webflow_-_Record_shop__CMS_tutorial_2018-09-19_17-01-57.png

Then declare some expiration dates (let’s put yesterday’s date for one item).

http://vincent.polenordstudio.fr/snap/Webflow_-_Record_shop__CMS_tutorial_2018-09-19_17-03-49.png

Also, all items need to have expiration dates set, for this filter to work. So let’s set dates in the future for all the other items.

http://vincent.polenordstudio.fr/snap/Webflow_-_Record_shop__CMS_tutorial_2018-09-19_17-06-20.png

Now select the collection list and set a filter on Expiration date, that says “From today to 999 days in the future”.

http://vincent.polenordstudio.fr/snap/Webflow_-_Record_shop__CMS_tutorial_2018-09-19_17-07-06.png

So now the list only shows items with a date equal to today or later.

3 Likes

Cool! That’s very helpful. But what if I want to expired a collection page instead?

@vincent question: is there a way to filter not just by date, but also by time? For example, if I wanted a specific CMS item to filter out after a certain time of the day?

Date field doesn’t do time easily.

For your time filtering:

Add a # field (numerical)
Set the time inside of it like 730, 1500 (for 7:30 AM and 3PM)
Then filter like this:

image

Here I have filtered out all the items that I had set to 1500