Hierarchy and Breadcrumbs (Developers)


What it is

DegDitor v1.2.0 introduces hierarchical relationships for pages and categories and exposes hierarchy-aware data for storefront rendering and APIs.

When to use it

Use hierarchy when:
  • you need structured content trees (parent-child)
  • navigation menus depend on content depth
  • breadcrumb generation should reflect both page and category ancestry

How it works

Data model

Migration Version20260209085857 adds:
  • fifty_deg_degditor_category.parent_id
  • fifty_deg_degditor_page.parent_id
  • fifty_deg_degditor_page.primary_category_id
Entities use HierarchicalEntityTrait for:
  • getParent()/setParent()
  • getChildren()/addChild()/removeChild()
  • getAncestors()
  • cycle-safe traversal helpers

Validation lifecycle

Validation runs:
  • on form submit via HierarchicalEntityFormSubscriber
  • on Doctrine prePersist/preUpdate via HierarchicalEntityListener
HierarchicalEntityValidator throws CyclicHierarchyException when cycle risk is detected.

API serialization

PageNormalizer and CategoryNormalizer append:
  • parent
  • children
  • ancestors
Hierarchy nodes are lightweight objects:
  • id
  • previewTitle
  • slug
API filters support:
  • parent.id=<id>
  • exists[parent]=0 for roots

Breadcrumb functions

Twig extension exposes:
  • degditor_get_page_breadcrumbs(page)
  • degditor_get_category_breadcrumbs(category)
Starter Pack breadcrumbs block can include category trail when page primaryCategory is set.

How to configure/use

Configure hierarchy in admin forms

  • Assign parent/children in Relations section for pages and categories.
  • Optionally set page primaryCategory for category-aware breadcrumb trails.

Storefront menu integration

Default menu templates render only root items in first level and use children for dropdowns.

Publishability behavior

Breadcrumb builders skip non-published entities using PublishableEntityService.

Common issues

Cyclic hierarchy error on save

  • Usually caused by direct/indirect self-parenting.
  • Remove conflicting parent assignment and retry.

Missing child in menu or breadcrumb

  • Check publication constraints (channel, enabled, schedule).
  • Check slug/title presence for breadcrumb node construction.

API consumer breaks after enabling hierarchy

  • Ensure consumer tolerates additional parent/children/ancestors fields.
  • Ensure consumer does not assume flat-only result structure.

Related docs

Your next step

Bring DegDitor to your Sylius store

Try the plugin

Experience the best features at no cost

Get a better understanding of DegDitor and how it works

Test it risk-free and see the results

Try it

Get a demo

Get a personalized demo tailored to your unique needs

Discover how reusable blocks speed up content creation

Evaluate DegDitor against your requirements

Get a demo

Find the right fit for your store

Tell us about your Sylius store and content needs. Talk to sales to explore the right DegDitor license, discuss integration, and plan your next steps.

Talk to sales