Im looking for some information on what the best practice is for creating document types without templates.
Lets say i am creating a home page carousel, i would create a parent node called Carousel Repository and allow child nodes of doctype carousel slide to be created. Neither of these use templates and are just simply targeted from the home template to be rendered out in the carousel.
However, without any templates being used if i navigate to the pages that use these document then i would say the ugly umbraco page not found error. e.g. http://mydomain.com/carousel-repository
What do people do to avoid this situation? Do you create a template and set up a redirect?
Im sure i have seen a package that may be used as a work around?
Unless the documents are meant to be page that you can actually visit as a user and view some information there should not be a template attached.
Remember that a visitor to the website will not see these pages or be able to access them using navigation etc. since the url for the document types are simply not rendered anywhere unless you decide to render them for some reason of course.
But in my experience people usually place "Content partials" or "Content elements" in a repository of their own, which the code targeting the website for the website navigation will never touch. So it's only from within the backoffice that it's possible to navigate these empty pages, which does not make much sense of course but that's the current state we have. I can't remember if there are any future plans to change this but if there are I think it's a couple of years into the future since it would be nice to not have url's created for document types, that have been created without templates indeed. But it should not matter too much that they exist as long as one is aware of not rendering the url's if they're being used as a part of the main content tree.
Just my 2 cents about it - I hope this makes sense? :)
Yes, I agree that if the doc type is meant to be a page that you donโt want the user to visit (i.e a landing page to create child pages from) then you should not be using a template. However, my concern is there is nothing stopping an end user manually typing the full URL and hitting a page that has no associated template and therefore rendering ugly umbraco template error.
This is why I was thinking about creating a generic template, associating it with all doc types that donโt use a template and putting a redirect to the home page on there.
Iโm not too sure what you mean about can you provide more info :)
But in my experience people usually place "Content partials" or "Content elements" in a repository of their own, which the code targeting the website for the website navigation will never touch. So it's only from within the backoffice that it's possible to navigate these empty pages, which does not make much sense of course but that's the current state we have.
Your feedback is much appreciated as its good to know what approach others are taking.
You're welcome and happy that it's useful to you :)
Well, end users typing a wrong url or coming to a page that does not exist happen for several reasons and usually that's handled by having a 404 page setup.
You can use the build in 404 page handler by setting up a special "404" page if you would like and then in the /config/UmbracoSettings.config file you can add the page id you would like to use for the 404 page - On the 404 page you can write some useful information and provide links for the user to get back on the right track. - We do this with a very very basic and stripped down 404 page on the 24 days advent calendar here http://24days.in/umbraco/pagedoesnotexist for instance (It could use some TLC) - You can of course style the 404 page anyway you would like.
I hope this helps a bit giving you some inspiration about how you can handle the different situations that can arise when a page does not exist or you need to handle that a page has existed in a certain place but now have been (re)moved.
That's exactly what I've done but instead of writing my own 404 handler I have downloaded Tim Geyssens page not found package and it solved the issue. It's simple to use and set up and if the user now requests a page with no template they are directed to a 404 page specified by me.
No worries - Did you attend CodeGarden 16? I did and I have just started the recovery process :)
Yes, that of course is another option - It's becoming harder and harder to keep track of all the available packages these days since there are so many nice ones added to the repo all the time.
A very simple solution that I've seen implemented elsewhere would be to actually associate your "no template" document types with a very simple template. That template's sole purpose would be to redirect to the node's parent. Not sure about SEO, but you would definitely get rid of ugly 404s as well as having to implement your own handlers. I would like to hear the community's opinions on this though before I definitely suggest it to you.
Doc Types without templates
Hi all,
Im looking for some information on what the best practice is for creating document types without templates.
Lets say i am creating a home page carousel, i would create a parent node called Carousel Repository and allow child nodes of doctype carousel slide to be created. Neither of these use templates and are just simply targeted from the home template to be rendered out in the carousel.
However, without any templates being used if i navigate to the pages that use these document then i would say the ugly umbraco page not found error. e.g. http://mydomain.com/carousel-repository
What do people do to avoid this situation? Do you create a template and set up a redirect?
Im sure i have seen a package that may be used as a work around?
Wondering what everyones approach is
Thanks Paul
Hi Paul
Unless the documents are meant to be page that you can actually visit as a user and view some information there should not be a template attached.
Remember that a visitor to the website will not see these pages or be able to access them using navigation etc. since the url for the document types are simply not rendered anywhere unless you decide to render them for some reason of course.
But in my experience people usually place "Content partials" or "Content elements" in a repository of their own, which the code targeting the website for the website navigation will never touch. So it's only from within the backoffice that it's possible to navigate these empty pages, which does not make much sense of course but that's the current state we have. I can't remember if there are any future plans to change this but if there are I think it's a couple of years into the future since it would be nice to not have url's created for document types, that have been created without templates indeed. But it should not matter too much that they exist as long as one is aware of not rendering the url's if they're being used as a part of the main content tree.
Just my 2 cents about it - I hope this makes sense? :)
/Jan
Hi Jan,
Thanks for the information.
Yes, I agree that if the doc type is meant to be a page that you donโt want the user to visit (i.e a landing page to create child pages from) then you should not be using a template. However, my concern is there is nothing stopping an end user manually typing the full URL and hitting a page that has no associated template and therefore rendering ugly umbraco template error.
This is why I was thinking about creating a generic template, associating it with all doc types that donโt use a template and putting a redirect to the home page on there.
Iโm not too sure what you mean about can you provide more info :)
But in my experience people usually place "Content partials" or "Content elements" in a repository of their own, which the code targeting the website for the website navigation will never touch. So it's only from within the backoffice that it's possible to navigate these empty pages, which does not make much sense of course but that's the current state we have.
Your feedback is much appreciated as its good to know what approach others are taking.
Many thanks Paul
Hi Paul
You're welcome and happy that it's useful to you :)
Well, end users typing a wrong url or coming to a page that does not exist happen for several reasons and usually that's handled by having a 404 page setup.
You can use the build in 404 page handler by setting up a special "404" page if you would like and then in the /config/UmbracoSettings.config file you can add the page id you would like to use for the 404 page - On the 404 page you can write some useful information and provide links for the user to get back on the right track. - We do this with a very very basic and stripped down 404 page on the 24 days advent calendar here http://24days.in/umbraco/pagedoesnotexist for instance (It could use some TLC) - You can of course style the 404 page anyway you would like.
Heather has a nice article on how to setup custom 404 pages on her blog here http://letswritecode.net/articles/how-to-setup-custom-error-pages-in-umbraco/ - You can also write you own 404 handler - I believe it's using the ContentFinder, which Jeroen Breuer has written a nice article about here http://24days.in/umbraco/2014/urlprovider-and-contentfinder/
That should cover if users for some reason end up on a page that does not exist.
If a page has existed on the other hand but has been removed / re-arranged to another place in the site try or simply deleted then a 301 redirect handler would be useful. There are plans of having 301 redirect handler in the Umbraco - There are also some package that can be used for handling it currently https://our.umbraco.org/projects/developer-tools/301-url-tracker/ and https://our.umbraco.org/projects/backoffice-extensions/simple-301/ - Also 301 handling is a part of the commercial package SEO checker from Richard Soeteman http://soetemansoftware.nl/seo-checker - But as mentioned it's also coming to Umbraco and according to the schedule it's planned for release with Umbraco 7.5 https://our.umbraco.org/contribute/progress
I hope this helps a bit giving you some inspiration about how you can handle the different situations that can arise when a page does not exist or you need to handle that a page has existed in a certain place but now have been (re)moved.
/Jan
Hi Jan,
Sorry for the delayed response I've been away.
That's exactly what I've done but instead of writing my own 404 handler I have downloaded Tim Geyssens page not found package and it solved the issue. It's simple to use and set up and if the user now requests a page with no template they are directed to a 404 page specified by me.
Thanks for your help
Paul
Hi Paul
No worries - Did you attend CodeGarden 16? I did and I have just started the recovery process :)
Yes, that of course is another option - It's becoming harder and harder to keep track of all the available packages these days since there are so many nice ones added to the repo all the time.
Happy I was able to inspire you a bit too.
/Jan
Hi Jan,
No unfortunately I wasn't at code garden ๐, something that is definitely on my list to do though. ๐. Sounds like you had a good time ha ๐ป
Yes the information you provided definitely helped me out so thanks for that. Yeas some awesome packages being made available from fellow umbraco users. The one I used from Tim can be found here https://our.umbraco.org/projects/backoffice-extensions/umbraco-page-not-found-manager/. It may help someone else in the future ๐.
Thanks Paul
A very simple solution that I've seen implemented elsewhere would be to actually associate your "no template" document types with a very simple template. That template's sole purpose would be to redirect to the node's parent. Not sure about SEO, but you would definitely get rid of ugly 404s as well as having to implement your own handlers. I would like to hear the community's opinions on this though before I definitely suggest it to you.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.