We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37437
    • 147 Posts
    I am running MODx 0961p2. I just want to confirm that the ’proper’ way to create a Directory in the document tree is to actually create a new blank document and then have it ’behave’ like a directory by making it the parent of documents that you place beneath (or, within) it. Is that right? Also, is it ok for a directory to act as both a published document in its own right as well as a container for other documents, or should directories generally be ’blank’ documents that simply act as containers for children documents?

    Thanks much for any clarification here.
      • 25663 MODX Staff
      • 12,272 Posts
      Yep. We call ’em "containers" around these here parts ... add all the content you want to ’em. wink
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 37437
        • 147 Posts
        Thanks for the clarification, Ryan. Appreciate the support.

        Marconi
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          All a "container" is is a document that has other documents using its ID as their "parent". When a document is specified as another document’s parent its "isparent" field is set to 1. Otherwise, it’s no different from any other document.

          A good example of a document that is also a container/parent is a main News page. The "news" document itself will probably just have some heading text "Latest News from Mysite", and a Ditto snippet call to create a list of links with summaries to news articles. The news article pages themselves are stored under the main News document.

          + News
          Article 1
          Article 2
          Article 3

          (of course, this means that any third-party snippets that set parent values need to make sure to set the parent document’s "isparent" field!)
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org