0

Using Drupal 9 or 10 Using a node type Page with one entity reference field, which is displayed as rendered entity, displaying the same Page content type.

When viewing a page, how do I prevent the page from having endless nested pages in it, leading to infinite loading? I like to limit the nesting to 4 levels deep.

4
  • 1
    What do you mean endless nested pages? You can set field cardinality to 4. If you are trying to create hierarchy, I suggest using the menu system. Using regular reference fields does not necessarily imply hierarchy at all (outside of Taxonomy or Menu Links, because it has support for that).
    – Kevin
    Jan 9, 2023 at 15:25
  • What I mean is that when a page display includes a fully rendered other page (in its entity reference field) which again has the same entity reference field thus fully rendered third page, that third page also has a fully rendered fourth page etc etc then there is infinite loading of pages. I want to prevent the infinite loading of nested pages from happening, but want to allow e.g. 4 nested pages to be displayed in each other.
    – Yuri
    Jan 9, 2023 at 20:46
  • My guess is you'll need to create a custom field formatter for you entity reference field.
    – sonfd
    Jan 9, 2023 at 22:13
  • This module might be a good direction for you: Custom Formatters
    – prkos
    Jan 12, 2023 at 0:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.