Kontent.ai gives you enough flexibility to create any content hierarchy you want. You can expose that hierarchy in your URLs in several ways. This cheat sheet explores user-friendly approaches you can consider so that you pick the right one based on your needs.
Why is this important?
Hierarchical URLs, an alternative to flat URLs, are great for knowledge portals, intranets, and websites with nested content.
Hierarchical URLs can look like /content-model/content-types/introduction.
Flat URLs can look like /introduction-to-content-types.
Adding hierarchy to your URLs offers many benefits:
User trust: Clean and hierarchical URLs appear more professional and trustworthy.
Improved usability: Users can easily navigate the site and understand their location within it, enhancing the overall user experience.
Contextual relevance: Hierarchical URLs provide context, helping users predict the type of information on a page.
Data analysis: Hierarchical URLs make it easy to drill down into your web analytics section by section.
Available solutions with Kontent.ai
Remember that your URL hierarchy doesn’t need to reflect your content hierarchy one-to-one.Consider your project’s requirements and the comfort level of your content creators when choosing the best method for implementing hierarchical URLs in Kontent.ai.
Approach A: Content and URL hierarchy through Web Spotlight
Use Web Spotlight to manage your website’s information architecture. With this navigation approach, content creators can arrange pages in a hierarchical structure. Your web app then uses this structure to generate hierarchical URLs automatically. You construct hierarchical URLs by using parent-child relationships between content items. Each content item links to a parent item and the web app combines the URL slugs from each level to form the full path.
Pros
Cons
User-friendly visual interface for content creators.
Automatic URL generation based on page tree.
Easy to rearrange pages and update URLs.
Reflects actual content hierarchy.
Improved SEO through nested keywords.
Flexible for complex structures.
May add complexity to content modeling.
Limited to website content managed through Web Spotlight.
Changes in the hierarchy can affect multiple URLs.
Approach B: Semi-hierarchical URLs based on content metadata
For semi-hierarchical short URLs, assign a URL prefix based on the content type, such as, /articles/ or /blogs/, and append the URL slug from each content item. This approach can also work with taxonomies.
Pros
Cons
Simple implementation.
Consistent and straightforward URL structure.
Easy for content creators to manage.
Less flexible for complex hierarchies.
Does not reflect content relationships beyond the prefix.
May not be optimal for SEO in all cases.
Approach C: Full relative URLs stored in content items
Each content item includes a text element where the full relative URL path is specified manually. Your web app uses this value directly when generating the URL.
Pros
Cons
Maximum control over URLs.
Easy to implement technically.
No dependencies on content relationships.
Allows to get an item by its entire hierarchical URL.
Prone to human error in URL input.
Inconsistent URL structures if not managed properly.
Difficult to update URLs across multiple items.
Tight coupling between content and a single presentation layer.