Now the node Testimonials and his child nodes are accessibel through the browser.
How can I prevent this and only allow the Testimonial childs to be accessibel in other template nodes? I what to display them on the home page using a macro ( partial view ).
Is testomonial just a content element? (Not a page) - If so, if it does not have a templated assigned it should not be possible to browse to the node since it won't be given any url (at least it has been working like that for a couple of minor versions ago).
However...if it's just content elements then I think you should really consider creating an "Element repository" at the root level of your content section (Same level as your homepage) where you can create folders for different kind of content elements, which you can then refer to by using either a content picker or a multinode picker on a content page. That way you're keeping pages and elements seperate and those elements won't be browsable since you don't add a hostname to the section.
It's a very common approach when building Umbraco sites, and other CMS sites.
So in your case I would suggest that you create 3 document types in your settings section.
1: "Content Elements" - This should be allowed to be created at the root level. Once it's created remove the checkbox from "allowed at root" on the document type. You only want one content element root.
2: Create a "Testomonials folder" document type and allow it to be created under "Content Elements"
3: Create a "Testomonial" document type and allow it to be created under "Testomonials folder"
This way you can have different testomonial folders if the need should arise and you have a place where you can add other folders and content elements if the need should arise without cluttering up the tree mixing pages and elements.
In your case you should be able to just create the "Content elements" root and then move your already created testomonial document structure down there.
If I remember correctly then yes - It's pretty easy to try out. Just remove the template and then you probably need to publish the testimonials branch. After doing that browse the "property" tab of the node and see if it has a url assigned. If not then you should not be able to browse the page. If it does not work you can always add the template to the document type again.
But as I mentioned above...if the only purpose of the testimonials is to contain data to be used on other pages then consider making a content elements section where you can keep them :)
Umbraco 7 create Child only nodes
Hi,
I have following Node structure:
Now the node Testimonials and his child nodes are accessibel through the browser. How can I prevent this and only allow the Testimonial childs to be accessibel in other template nodes? I what to display them on the home page using a macro ( partial view ).
/Michael
Hi Michaël
Is testomonial just a content element? (Not a page) - If so, if it does not have a templated assigned it should not be possible to browse to the node since it won't be given any url (at least it has been working like that for a couple of minor versions ago).
However...if it's just content elements then I think you should really consider creating an "Element repository" at the root level of your content section (Same level as your homepage) where you can create folders for different kind of content elements, which you can then refer to by using either a content picker or a multinode picker on a content page. That way you're keeping pages and elements seperate and those elements won't be browsable since you don't add a hostname to the section.
It's a very common approach when building Umbraco sites, and other CMS sites.
So in your case I would suggest that you create 3 document types in your settings section.
1: "Content Elements" - This should be allowed to be created at the root level. Once it's created remove the checkbox from "allowed at root" on the document type. You only want one content element root.
2: Create a "Testomonials folder" document type and allow it to be created under "Content Elements"
3: Create a "Testomonial" document type and allow it to be created under "Testomonials folder"
This way you can have different testomonial folders if the need should arise and you have a place where you can add other folders and content elements if the need should arise without cluttering up the tree mixing pages and elements.
In your case you should be able to just create the "Content elements" root and then move your already created testomonial document structure down there.
I hope this makes sense and is useful :)
/Jan
Hi Michael,
Very simple way to prevent access via browser at folder node, is add redirect at this node. It isn't perfect solution but very simple.
Thanks
Try this: Add this to your home template:
Create a partialview /Views/Shared/Testimonial/_Testimonial.cshtml
And add this code to the partialview:
And --- Testamonials --- Change this! = your testimonial documenttypealias
Hi all,
thanks for the replies. I will give you some more info about my Document Types. This is the current structure:
Every documenty type is a page so it has a template. Is it enough to just remove the template link from the testimonials?
Creating the partial view ( macro ) is done so this is not a problem, it is only the accessability of the testimonials I would like to avoid.
Hi Michaël
If I remember correctly then yes - It's pretty easy to try out. Just remove the template and then you probably need to publish the testimonials branch. After doing that browse the "property" tab of the node and see if it has a url assigned. If not then you should not be able to browse the page. If it does not work you can always add the template to the document type again.
But as I mentioned above...if the only purpose of the testimonials is to contain data to be used on other pages then consider making a content elements section where you can keep them :)
Hope this helps.
/Jan
is working on a reply...