Working with hierarchies
Hierarchies are tree structures of content items that can be used to represent everything from product categories, to store locations or site navigation. We've made it easy to work with hierarchies in Dynamic Content and you create and edit hierarchies in the same way that you work with other content, with a few differences. On this page we'll provide an overview of how you create, edit and publish hierarchies.
For a more technical introduction to hierarchies see the hierarchies page.
Creating a hierarchyLink copied!
You create a hierarchy as the same way as you do any other content item, by choosing "Create content" in the Content Library and choosing a content type. The only difference is that the content type you choose will be set up to make the content item part of a hierarchy.
In this example, we'll create the hierarchy for a site menu. This is created from a content type called "Site menu item".
The content editing form opens. You'll notice two differences from a standard content form: the "Hierarchy" label is shown in the top left of the window and the form is divided into two, with a edit text box shown on the left and a normal content form, with all its properties, shown on the right.
The hierarchy is shown as a tree of nodes. The first node we enter will be the root node, the one from which all other nodes descend. We'll add the label for this node "Site menu".
The rest of the content item properties can be added as normal. In this simple example we're just including the menu item's name and description. We'll keep the label and the title the same, but they don't have to be.
When you've finished entering all the fields click "Save". For a content item that is part of a hierarchy, the label must be entered and you won't be able to save if you leave the label box empty. The label will be used for the content item name.
The content item is now saved and you can see that it has content item properties just like any other content item. You can now add child items to this node.
Adding an item to a hierarchyLink copied!
To add an item to a hierarchy you will add a child to an existing item. We currently have just one node, the "Site menu" root node. Right-clicking any node will show a menu of options, including adding a child node. Choose the "Add child node" menu item.
Give the item a label and fill in its properties. In this case we want to represent the "Womens" area of our site.
When the item is saved, the node labelled "Women" is added as a child to the root node.
We can now add "sibling" items at the same level, or add a child item to the women's section. Clicking the "+" icon to the right of a node is quick way to add children. We'll add "shoes" and "clothing".
Clicking any of the nodes in the hierarchy will open the content item, making it easy for you to traverse the tree.
Adding an existing node to a hierarchyLink copied!
You can add an existing item to a hierarchy, but the item you choose to add cannot already be part of a hierarchy. This means that you can add any item that does not already have a parent.
In the example shown below we've created a hierarchy for the "electricals" section of a website and we want to add this to the website menu hierarchy.
To add an existing item, choose the item you want to be its parent and select "Add existing node" from its menu. In this case we want to add the "Electricals" item to the top level of the hierarchy, so we'll choose the root node "Website menu" as its parent.
The content browser opens showing items that can be added to this hierarchy. We'll choose "Electricals".
All of the descendants of the "Electricals" item are now added to the hierarchy.
Note that if we'd tried to add "Personal care" or "Razors" to the hierarchy we would get an error, because these items are already children of "Electricals".
Renaming a nodeLink copied!
To change a node's label, right click and choose "rename" from the menu.
Enter the new label and click "Ok". The content item name is updated and the node label will change.
Moving a nodeLink copied!
You can drag items from one parent to another within a hierarchy.
In the image shown below, the "Bathroom" node is dragged from the "Home" parent to become a child of "Clearance".
Removing a nodeLink copied!
You can also remove a node from a hierarchy. Removing a node does not delete the content item that it represents, it just removes the content item from the hierarchy. To remove a node, choose its parent node and select "Remove node" from the menu. In this example we want to remove "Special offers" from the hierarchy.
When you remove a node, any descendants will be removed as well.
A message is displayed warning you that this node, and all its descendants, will be removed from the hierarchy. Click "Ok" to proceed.
The "Special offer" node has now been removed.
Publishing a hierarchyLink copied!
You publish hierarchies in the same way as any other content item and you can choose to publish a single node, all of the hierarchy or just a part of it.
To publish a node, right click and choose "Publish" from the menu.
You will be asked if you want to publish just the node itself, or all of its descendants. We chose to publish the root node, so if we choose to publish all of its descendants, then the entire hierarchy will be published. For this example we'll choose to publish all descendants.
All of the content items in the hierarchy are now published.
Viewing hierarchy items in the Content LibraryLink copied!
The content items that are part of a hierarchy can be viewed, filtered and organized in the same way as other content items. In the image below you can see two items: the website menu root node content item and the "Special offers" node that we removed from the hierarchy. The child content items are hidden by default because "Hierarchical child nodes" is turned off. If we turn this option on, then all of the child items will be shown.
All of the content items that are part of the hierarchy are now shown.