Reputation: 429
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. i.e. Team 1 folder has A-G in it. Team 2 folder has H-Q. Team 3 has R-Z 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?
Upvotes: 1
Views: 5126
Reputation: 4257
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.
Upvotes: 2
Reputation: 5712
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
propertyStep 3
Allow this folder under your root Home
node.
Home
root propertyContentFolder
type to allow as a childStep 4
Add you folder structure and add pages.
Content Folder
HQ
A
that's allowed under your folderHQ
set the Redirect
property to your first A
pageAnd thats it!
Upvotes: 7