Skip to main content

Working with hierarchies

Hierarchies are tree structures of content that can be used to represent everything from product categories, to store locations or site navigation. With Dynamic Content you create and edit hierarchies in a similar way to working with other content.

For a technical introduction to hierarchies, see the Developer guide to hierarchies.

Creating a hierarchy
Link copied!

You can create a hierarchy by choosing "Create content" in the content library and choosing a content type that has been set up for use with a hierarchy.

In this example, we'll create the hierarchy for a site menu. This is created using a content type called "Site menu item".

Choosing the content type from which to create a hierarchy

When you're working with hierarchy content types, you'll notice that the content authoring experience shows:

  • A "Hierarchy" label in the top left of the window
  • The window is divided into two, with an edit text box shown on the left and content fields on the right

The hierarchy is shown as a tree of nodes. The first node in the tree is the root node, the one from which all other nodes descend. In this example, we'll label the root node "Site menu".

The top node in the hierarchy is the root node from which all other items descend

The rest of the content can be added on the right. 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.

Adding the rest of the content item properties

To save the hierarchy node and its content, click "Save". Note, a node label must be entered to save. The label is used as the content item name, and will help you identify the content in the content library.

Saving the content item

Once the content is saved you can view its properties, and add child items to the node.

The content is saved and items can be added to the hierarchy

Adding an item to a hierarchy
Link copied!

To add an item to a hierarchy you add a child to an already existing item. Our example below has just one node, the "Site menu" root node. Right-clicking any node will show a menu of options, including "Create new child node".

Adding an item to the hierarchy

Give the item a label and fill in its properties. In this case we want to represent the "Womens" area of our site.

Setting the item label

When the item is saved, the node labeled "Women" is added as a child to the root node.

The item is added as a child of the Website menu node

We can continue to add more nodes at the same level, and build up a hierarchy of levels.

Shortcut for adding child nodes

Clicking the "+" icon to the right of a node is a quick way to add child nodes.

Clicking any of the nodes in the hierarchy will open the content item, making it easy for you to traverse the tree.

Clicking the + icon is a quick way to add a child item to its parent

Adding an existing node to a hierarchy
Link copied!

You can include existing content in a hierarchy, however that content cannot already be part of a hierarchy. This means you can add any item that does not already have a parent.

In this example we've created a separate hierarchy for the "Electricals" section of a website and we want to add this to the main website menu hierarchy.

The Electricals hierarchy

To add an existing item, open the parent item, then click the ellipsis (...) of the parent node where the new item will be added and select "Add existing node". Here, 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.

Choosing to add an existing node

The content browser opens showing items that can be added to this hierarchy. We'll choose "Electricals".

Adding the electricals hierarchy

note

Items that need converting can't be added to a hierarchy. See Converting existing items for use with hierarchies.

All descendants of the "Electricals" item are added to the hierarchy.

Electricals and all its child items are added to the hierarchy

Note that if we now 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 node
Link copied!

To change a node's label, right click and choose "rename" from the menu.

Choosing to rename an item in the hierarchy

Enter the new label and click "Ok". The content item name is updated and the node label will change.

Renaming the item will change its label and the content item name

Moving a node
Link copied!

Hierarchy nodes can be reordered by dragging and dropping them.

The image below shows the "Beachwear" node being moved from the "Womens" branch to the "Clearance" branch.

Shortcut

Dropping a node directly onto a parent node (rather than below it) puts the node within that branch without having to expand it.

Dragging a node from one branch to another

You can also use drag and drop to move and reorder nodes within the same branch.

Drag and drop within same branch
Link copied!

Dragging and dropping within the same branch is a feature that can be set up by your developers.

Developer note

For information about enabling drag and drop within a branch, see the Developer guide - hierarchy drag and drop.

This example shows reordering a node within the "Electricals" branch. A solid, blue guide bar indicates where a node will be placed.

Dragging a node from one branch to another

Rules for drag and drop
Link copied!

Sometimes, you might notice that you're unable to drag a node to a position. The guide bar indicates this with a light, dotted line, like this:

Drag and drop not allowed

Drag and drop will be prevented or affected for the following reasons:

  • The destination/target node is a descendant of the node you're dragging (as shown above).
  • The node you're dragging is not supported by the destination/target node. Ask your developer about the node's schema allowedTypes.
  • The destination/target node does not have drag and drop configured. Ask your developer about enabling hierarchy drag and drop.
  • The destination/target node has archived or unsupported content type child nodes. Note in this scenario, you can move the node, but you will not be able to drag and drop within the destination branch.
Maximum nodes in a hierarchy branch

Hierarchy drag and drop is currently supported for branches containing up to 200 nodes.

Removing a node
Link copied!

You can remove unwanted nodes from a hierarchy. Removing a node does not delete the content that it represents, it just removes the content item from the hierarchy. Removing a node, will also remove any of its descendants as well.

When you simply remove a node from a hierarchy, the link between the node and its parent still exists in the published version of your content. To ensure that the node is no longer included in published hierarchy content you need to either:

  • Remove the node from the hierarchy and then re-publish the node. The node will remain in your published hierarchy content until you re-publish it. Use this approach if you still want to retrieve the published version of the content item once it's been removed from the hierarchy. See the Developer guide for removing a node from a hierarchy.

or

Removing an archived node

To remove an archived node from a hierarchy, you must first unarchive the node and then use "Remove node".

To remove a node, select it and choose "Remove node" from the menu.

In this example we will remove "Special offers" from the hierarchy.

Choosing an item to remove from the hierarchy

A message warns that this node, and all its descendants, will be removed from the hierarchy.

You will be warned that all child items will be removed too

In our example, the "Special offer" node has been removed.

The node is removed from the tree

Publishing a hierarchy
Link copied!

You can choose to publish a single node, all of a hierarchy or just a part of it.

To publish a node, right click and choose "Publish" from the menu. Here we're publishing the Website menu item and all of its children:

Choosing to publish an item in the hierarchy

You will be asked if you want to publish just the node itself, or all of its descendants. For this example we'll choose to publish all descendants.

You will be notified that all descendants of the item will be published

Once published, each hierarchy node is updated with an icon to show that the latest version is published.

The item and its children are now published

Blocked publishing
Link copied!

When publishing a node and its descendants, if any of the descendants are archived, publishing is blocked and none of the nodes will be published.

Here's how you'll be notified if archived nodes are blocking publishing:

Warning of publishing blocked by archived node

Unpublishing hierarchy nodes
Link copied!

When you unpublish a node, that content will no longer be included in your published hierarchy content. If you no longer need the unpublished content, remove the node from the hierarchy.

You can unpublish the root node of a hierarchy, and any of its individual child nodes.

note

You can only unpublish hierarchy nodes one at a time, to help prevent accidentally unpublishing content.

Viewing hierarchy items in the content library
Link copied!

Content that is part of a hierarchy can be viewed, filtered and organized in the same way as other content items. The image below shows 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 the "Hierarchy child nodes" setting is turned off.

Showing hierarchical child nodes is off so only the root node content items are shown in the Content Library

To list all of the content items that are part of the hierarchy, show "Hierarchy child nodes".

All the content items that are part of the hierarchy are shown

Converting existing items for use with hierarchies
Link copied!

If a content item's type is updated from being non-hierarchical to hierarchical after the item was created, the item must be converted before you can add it to a hierarchy.

To convert an item for use with hierarchies, open it from the content library. The item is opened in the content form, overlaid with the "Convert item to hierarchy" dialog. To continue you must convert the item.

The Convert item to hierarchy dialog

When an item is converted it retains all of its field information, and a new version of the item is created.

If you convert a published item you will need to republish it after converting.

Note, if you try to restore to a version of content that was created before an item was converted, you will be prompted to convert the earlier version. See Viewing content revision history

Developer info:

If you update a schema content type with the trait:hierarchy object, all existing content items for that schema will need to be converted before the items can be added to a hierarchy. See Developer guide - The hierarchy trait.

Archived content
Link copied!

In Dynamic Content, archived content is represented using orange colored nodes with the "Archived" icon, like this:

Example of an archived node in the hierarchy

Archived nodes must be unarchived before you can publish, rename, or move them.

Unsupported content types
Link copied!

When content types are removed from the list of permitted types in a hierarchy, this results in unsupported types. For example, content types that are no longer used by a hierarchy may be removed from the hierarchy schema (by a developer) to prevent users from adding any more content of that type.

In Dynamic Content, nodes that represent unsupported content types are colored white, as shown below:

Example of an unsupported content type node in the hierarchy

Unsupported content type nodes will prevent reordering of other nodes in the same branch.

Finding out which content types are supported by hierarchies

As a developer, you can check which content types a hierarchy supports, by checking the trait:hierarchy of the content type schema. In the example shown below only content items created from the schema registered with the URL https://schema-examples.com/site-menu-item can be added as children.


"trait:hierarchy": {
"childContentTypes": [
"https://schema-examples.com/site-menu-item"
]

Developer guide to hierarchies

Hierarchies limits