U4-3003 - Automatically 'hide' pages with no template

Created by Douglas Robar 01 Oct 2013, 10:33:23 Updated by Shannon Deminick 21 Jun 2017, 07:58:15

Relates to: U4-2586

If I create a document type that doesn't have a template, any pages I create in the content tree also have no template (obviously :) but those pages get a URL and if you follow the URL you'll get the 404 page because there's no template. In this case you would set the umbracoNaviHide property to hide pages without a template.

Would it be appropriate to automatically 'hide' pages without templates?

Not sure about the implementation details. The umbracoNaviHide state could be set automatically (even if the property hasn't been added to the doctype?). Or perhaps not by actually setting the umbracoNaviHide state but by updating the .Where("Visible") razor code (and equivalent checks in other places) to not include any results that have no template since clicking on those pages will result in a 404 anyway.

(This is a suggestion from a new user and I suddenly thought, "yeah, why haven't we old timers thought of that?")


Tom Fulton 04 Oct 2013, 04:06:52

Hey Doug, as Funka! found I also thought the same thing in U4-2586, but I think maybe I didn't consider all of the use cases. Sebastiaan's argument was that you may still want to list pages with no template, for example in cases like a Homepage Slider or News Items, etc - so not sure it makes sense to implement globally. Something still doesn't feel quite right though, but not sure what the ultimate solution would be.

Douglas Robar 08 Oct 2013, 14:44:57

Thanks, Tom. I agree there are times when I might want to list pages without templates (those 'data only doctypes' you mention, for instance).

Unlike what you were thinking, I was proposing a change only to the .Where("Visible") logic to say that a page without a template is by default, not visible. But I can see that's a magic overload to an already semi-magic where clause and probably isn't a great idea.

Let's shelve this request until someone can come up with a more considered and workable solution. I love the basic premise of the OP but can see there are subtleties that make it tricky.

Shannon Deminick 21 Jun 2017, 07:58:15

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/

Priority: Normal

Type: Feature (request)

State: Closed


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version:


Story Points: