I have many pages in the content section of Umbraco but some of the pages I would like to organize for departmental reference not necessarily for hierarchical site reference. For example, my pages might be A, B, C, D ... Z on the website but on the backend we have various teams that need their content grouped together. ie Team 1 folder has AG in it. Team 2 folder has HQ. Team 3 has RZ in it. How can this be achieved so instead of seeing all the content on the root of the content page I only see these 3 team folders?
You have to be carefull in achieving this. When you create new nodes under your Home
root node, eg new pages or folders, they are referenced with an url.
So If you have a page called A
, this will be accessed using the url http://www.example.com/a
. When you create folders to organize pages and you place page A
under HQ
, then your page will now be accessed by http://www.example.com/hq/a
.
After that you can use url rewriting rules to avaid these folders indications in your url but that will be messed up if you have many pages.
I will suggest if you don't want to see these folder indications in your url, to just add all the nodes under your Home
node and using Permission
to allow/disallow departments to the nodes.
If you don't care about the folder indications in your url, let me know then I will edit this answer with the solution to achieve this.
EDIT
How to add folder structure in your content nodes.
Step 1
Create a new Document Type
called Content Folder
.
Settings
> Document Types
> click on the 3 dots > Create
. Content Folder
. Redirect
with alias umbracoRedirect
with type Content Picker
The builtin property
umbracoRedirect
is used to redirect one node to another using its id. So for each folder set this property to the first child page.
Step 2
Allow your child node types in this folder.
Content Folder
property Step 3
Allow this folder under your root Home
node.
Home
root property ContentFolder
type to allow as a child Step 4
Add you folder structure and add pages.
Content Folder
HQ
A
that's allowed under your folder HQ
set the Redirect
property to your first A
page And thats it!
Another way of doing this is with a custom URL Provider and Content Finder. This is where you create a new provider for working out the URL of the pages on your site, overriding the default folder structure.
You can add your own logic out strip out folders from the URLS, so /folder/a/content could become /folder/content. Obviously you'd need to be careful that the other folders don't contain items with the same names, or you may get the wrong content returned.
The advantage of a URL Provider is that whenever you call the Umbraco methods to get the URL of a content item, you'll ALWAYS get the custom URL.
The content finder is a way for the site to match the modified URLs back to the original content. You'll need both for it to work.
Here is a link to an in depth article about using these two in conjunction in an Umbraco site.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.