This is probably going to be a no brainer and I apologize in advance.
Lets create a document type foo, and give it a template fei, then a content node names fah.
Add in whatever fields into foo, and render them in fei and populate and publish fah.
Currently on my sandbox - which has a vanilla config - a user can go to /fah and the page will load fine.
A user can also go to /fei and get a yellow screen of death - which is understandable, there is no model associated with the view.
My question is, how do you prevent the user from accessing /fei in the first place. Traditional .net MVC you would just name the view _SomeView and it wouldn't be directly served up - but if I do that, Umbraco doesn't see it for me to map to it as a template.
I think this is a legacy thing. Older versions didn't have this setting. So alt templates would always be enabled. Setting it to true by default could potentially break sites when upgrading.
Question over routing/view access
This is probably going to be a no brainer and I apologize in advance.
Lets create a document type foo, and give it a template fei, then a content node names fah.
Add in whatever fields into foo, and render them in fei and populate and publish fah.
Currently on my sandbox - which has a vanilla config - a user can go to /fah and the page will load fine.
A user can also go to /fei and get a yellow screen of death - which is understandable, there is no model associated with the view.
My question is, how do you prevent the user from accessing /fei in the first place. Traditional .net MVC you would just name the view _SomeView and it wouldn't be directly served up - but if I do that, Umbraco doesn't see it for me to map to it as a template.
Hi Joe,
Go in to your umbracoSettings.config file and locate web.routing section.
Set the value of the attribute
disableAlternativeTemplates
to trueThis will disable accessing content with a template name.
Read more about it here : https://our.umbraco.org/documentation/Reference/Config/umbracoSettings/#web-routing
Dave
I guess I should really RTFM... but that brings up a point, wouldn't it be beneficial for this option to be set to true to begin with?
hi Joe,
I think this is a legacy thing. Older versions didn't have this setting. So alt templates would always be enabled. Setting it to true by default could potentially break sites when upgrading.
Dave
is working on a reply...