Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm building a new site on Umbraco 6.0.2. Its content tree looks like this at the moment:
It uses these templates:
I typed in "website.com/contact", forgetting that the URL should actually be "website.com/company/contact" and was puzzled to see the homepage content presented in my Contact template. Once I figured out that I had typed in the wrong URL, I realized that this was the 'alternate template' functionality at work, and because some of my template names are the same as my page names, it was causing confusing behavior.
I decided it was probably a bad idea to name the templates like I did, and renamed them to ContactPage, DownloadsPage and NewsPage, but I'm still concerned that this alternate template functionality could cause similar confusion down the road. Is any way I can disable the 'specify an alternate template in the URL' functionality, at least in the format of "website.com/pagepath/templatename"? I wouldn't mind keeping "website.com/pagepath?alttemplate=templatename" active, because that's much less confusing, but if it's all or nothing, I'll just turn them both off.
Any help would be appreciated,David
I'm not sure how it can be disabled. But I'm not really sure it's going to be a real issue for you?
It's not like the alternate pages are being indexed in search engines and unless you use them in your navigation for the site for some reason website visitors will probably never even hit those pages. Especially not now that you have named your templates with the appending "Page" convention.
So I guess I'm saying I don't think this will be a problem for you when people browse the site hence I don't think it's worth spending time on fixing imho :)
However I'm curious if someone knows how to turn it off though - always fun to learn something new.
We've also met the issue that you can't disable the alternative template URL parameter.
However, you should be able to disable the URL resolution for it, by removing
<notFound assembly="umbraco" type="SearchForTemplate"/>
I don't know specifically which versions of Umbraco this works in, but I think it's probably worth a try.
Hope this helps.
I prefix all of my template aliases with "tpl" (e.g., "tplContactPage") so that these are quite unlikely to ever be typed in by accident or even legitimately by an umbraco admin or editor. For the same reason you noted, even though I realize I'm just repeating what you already found as your solution.
I know this topic is old, but just stumbled upon it and wants to share my experiences on the matter.
When working with permissions it's very important to disable "SearchForTemplate" as Michael mentions above. Because hitting a page by it's template name is NOT protected by any permissions. Of course when hitting a page by it's template name, you're out of the Content tree context, and most pages will therefore fail. But sometimes you do e.g. a utility page for your project (which is not dependent on any content) and restrict it's public access. But you can access the page anyway by using it's template name in the url (and because it being out of the content tree context, there's no restrictions at all). It requires that someone guesses the template name of course, but I don't like knowing that restricted pages are publicly avaiable in any form.
I've always been puzzled why this has been default behavior in Umbraco since the dawn of day. The use case for this behavior cannot be common at all.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted