I just make sure that no link is every displayed that would link direct to that item. When creating navigations and such, I'll usually create a paramter within it called "excludes" which contains a list of docTypeAlias' to exclude, I then do a check in my for-each statement. I even modify XSLT search in a similar way (though Doug mentioned he was implementing something similar). And then end of it, it's just a case that there is nowhere on the site that links to the page, that it is never displayed (yea you could go direct, but who would know it's there?)
If I was going to implement a redirect, i'd be sure to make it a 301 so that search engines don't bother going back.
You mean by making a BeforePublish event and then set the umbracoRedirect to his parentId. Seems like a good solutions either but then you have to do this for every DocumentType.
If you put the logic in the template you can just make one template and the call that template whenever needed.
A couple of other things I've thought about on the redirect.
1) You may want to make it smarter incase you nest "RepositoryDoctypes" as you would get a series of redirects in your current situation (not sure how google interprates mulitple redirects)
2) It's only good for RepositoryDoctypes that are situated within the bounds of your website. I'll often create a "Misc" folder outside of the root of the site, redirecting to parent on these would be pointless, as they'd never get to a page that is valid (unless you do a final check and just redirect to homepage).
All answers combined, i think this could be the best way for me.
1) A BeforePublish event based on a doctype (repository). This document type contains a parameter like "umbracoNiviHide" that is set default to true. 2) The selected template must have the redirect.
In this soulution your client does not have to do anything, and te created node cant be reached in search engines.
Step 2 of Matts solution is also good, but learning from experience it is not always the easiest way to work for customers.
How do you handle doctypes that don't need a template?
How do you handle doctypes that don't need a template, the so called RepositoryDoctypes?
My Do's:
My Don'ts:
Can you agree with this aproach or is there a much better way to do this?
If so, let me know.
Hi Bram
I generally don't go to that extent.
I just make sure that no link is every displayed that would link direct to that item. When creating navigations and such, I'll usually create a paramter within it called "excludes" which contains a list of docTypeAlias' to exclude, I then do a check in my for-each statement. I even modify XSLT search in a similar way (though Doug mentioned he was implementing something similar). And then end of it, it's just a case that there is nowhere on the site that links to the page, that it is never displayed (yea you could go direct, but who would know it's there?)
If I was going to implement a redirect, i'd be sure to make it a 301 so that search engines don't bother going back.
Matt
Hi Matt, Bram,
I was thinking about a solution to. And I wonder if its possible to set the checkbox as checkt by default (maybe based on docTypeAlias).
Bas
301 is a good point Matt
Response.StatusCode = 301;
Response.AddHeader("Location", current.Parent.NiceUrl);
Hi Bas,
You mean by making a BeforePublish event and then set the umbracoRedirect to his parentId.
Seems like a good solutions either but then you have to do this for every DocumentType.
If you put the logic in the template you can just make one template and the call that template whenever needed.
A couple of other things I've thought about on the redirect.
1) You may want to make it smarter incase you nest "RepositoryDoctypes" as you would get a series of redirects in your current situation (not sure how google interprates mulitple redirects)
2) It's only good for RepositoryDoctypes that are situated within the bounds of your website. I'll often create a "Misc" folder outside of the root of the site, redirecting to parent on these would be pointless, as they'd never get to a page that is valid (unless you do a final check and just redirect to homepage).
Matt
All answers combined, i think this could be the best way for me.
1) A BeforePublish event based on a doctype (repository). This document type contains a parameter like "umbracoNiviHide" that is set default to true.
2) The selected template must have the redirect.
In this soulution your client does not have to do anything, and te created node cant be reached in search engines.
Step 2 of Matts solution is also good, but learning from experience it is not always the easiest way to work for customers.
Bas
is working on a reply...