Draft by default

I’m sure this has been discussed before but can’t find anything on this: how about a draft version by default when creating page via the panel?

The thing is when you create a page from a template, the page is instantly visible - before it has any content.

Of course, I can think of some practical workaround but it seems this draft feature could be useful anyway for “plain” users.

Been using Kirby for 2 years but… am I missing something?

Well, actually a page is always created as an invisible page and only gets visible after changing this status (publishing it). In your templates you would need to use $pages->visible() instead of just $pages however.

Thanx for your answer @distantnative.

Yes, we can use $pages->visible()… but the page remains accessible via its url (see doc “Invisible pages are still accessible via their URL”). It is not a draft but just an exclusion from menu, if I’m not mistaken.

In addition to this, if I use $pages->visible(), the page doesn’t get visible after “publishing it” (at least on our side) but only, logically enough, after drag-and-dropping it in the visible section.

No big issue there for us but still wondering if a draft feature…

With “publishing” I was referring to the new toggle from the 2.1 beta - an alternative to the drag and drop.

But true, what I have done in one project, where I wanted to make sure blogposts can’t be accessed at all before being “visible”: Added some code in the controller of my article template, which would refer the visitor to the error page if the page/article is invisible or the date field is still in the future.

With the new version of Kirby, there is a new button in the panel, where you can switch from invisible to visible. You can also use a separate draft field and prevent access to those pages:


Think, you can do the same for invisible pages …

[Edit:] @distantnative beat me to it …

Some promising tweaks/features here, thank you for your answers @distantnative and @texnixe!

If you’re feeling very clever it would be sensible to do a user check alongside the visible check, in order to allow editors to still preview the page…

Yes. Actually at first I thought my being administrator explained all articles were visible.