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.

General

Unpublished blog shows children articles

Started by Pedro M 2 years ago · 0 replies · 217 views
2 years ago

I'm working on a personal page to which I want to add a blog section, with some articles, but I want to leave that section disabled for now. If I unpublish the blog page, I can still access the child pages (item type)

Is there a way to prevent the child pages of a collection from being accessible if the parent page is unpublished?

To avoid seeing some modular parts of the home page, as latest posts has been simple:

TWIG
{% if blog.published %}
{% include 'partials/sidebar/latestposts.html.twig' with {'blog': blog } %}
{% endif %}

But I don't know if I should do the same in the item.html.twig template or is there some different way.

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 10 hours ago
General · by pamtbaau, 15 hours ago
1 51 15 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago