Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

How to set hide or visible page by the unpublished date

Solved by pamtbaau View solution

Started by Pedro M 6 years ago · 2 replies · 1251 views
6 years ago

Hi,
Is it possible make visible or hide a modular page by its unpublished date?.

I've been trying to do it but I can't get it.

Anyone knows to do it?

Thanks.

6 years ago Solution

@pmoreno, When variable unpublish_date is set in the frontmatter of a page, it should become 'un-published' automatically.

See https://learn.getgrav.org/16/content/headers#unpublish-date

Optional field, but can provide a date to automatically trigger un-publication. Valid values are any string date values that strtotime() supports.

What have you been trying?

6 years ago

Hi, @pamtbaau,

I don't know what happened, but I had marked the unpublished checkbox, however the page didn't hide.

Maybe it worked wrong because I set enable the Publis checkbox, or the cache enabled. I'm not sure.

Finally, it works fine now.
Thanks so much, again.

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 99 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 186 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 148 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 62 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 257 1 year ago