Skip to the content
Documentation

Include limits

No ratings yet

What are the limits on includes? Can I include within an included file? Can I include within an override? Can I include the same file within itself?

Comments (2 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. Re: Include limits

    Bertrand Dunogier ·

    - Can I include within an included file?
    Yes
    - Can I include within an override?
    Yes
    - Can I include the same file within itself?
    Yes

    1. Re: Re: Include limits

      Kristof Coomans ·

      You have to watch out when including the same file within itself (recursive) if you are defining (def, let) variables in it, this can cause endless loops (the def and let statements will fail because the variable already exists) and you'll have to wait a long time for your page to load (until you reach the maximum template nesting level).
      A solution to this is using a unique name parameter to define a new sub-namespace.