We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13740
    • 86 Posts
    I want to insert a wayfinder navigation section on each page in my site IF there are more than a certain number of child pages for the document, otherwise I want so show different content. Is this do-able and if so, how?

    Thanks!
      • 7231
      • 4,205 Posts
      Very doable with a few options on how to do it. There may even be a snippet around that can load a chunk if doc has children (I think I remember seeing something like this).

      1) If you are not a coder then you may consider installing PHx plugin and use that for the logic.
      2) Build a wrapper snippet and use the MODx api to see if there are children or not. The getChildIds() function will return a list of children IDs for a document and you can simply see if there is a value, if true run snippet, else do nothing. Read about the wrapper snippet concept on this blog post:
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]