We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37272
    • 216 Posts
    Hi,

    MODx Rev.

    My webpages are made up from two documents: one for the main content on the right; and a second document for the left, consisting of page menus, and other small pieces of information.

    At the moment, I use a TV to identify the ID of the child document (the document for the left side content). Is there a way that the left side document could be automatically selected based upon the parent document (the one that is used for actual webpage, utilising the template)? The left side documents all have the same alias and title.

    So, some way of automatically selecting a child document of given alias or title for insertion to the template?

    Thanks. [ed. note: colinx last edited this post 14 years ago.]
      • 30585
      • 833 Posts
      Can you show a live example of what you currently have? Your problem description is a little confusing
        A MODx Fanatic
        • 37246
        • 128 Posts
        Grey Sky Media Reply #3, 14 years ago
        it kind of sounds like on your left menu, i'm assuming you're using wayfinder, you want it to mark that page as selected. Wayfinder does this by default.

        If you're not using wayfinder i know you could do this via javascript.

        As treigh said though, the description is a tad bit confusing, an example would be very helpful
          I LOVE MODX! | greyskymedia.com
          • 37272
          • 216 Posts
          Hi,

          I'll try to explain again.

          Each of my webpages consist of two documents (a parent and child).

          Template:

          HTML
          [[*content]] (the right side, the main content of the webpage)
          HTML
          [[*left-column]] (the left side of the page, with links to individual sections on the page, disclaimer, and other chunks)
          HTML


          Resources (document tree):

          - Home (webpage main content)
          -- left column
          - Dogs (webpage main content)
          -- left column
          - Cats (webpage main content)
          -- left column

          The 'left column' documents are hidden from the menu and are unpublished, but the content of each 'left column' resource is called by the template and are individually selected by a TV in the parent resource document.

          What I'd like to do, rather than use a TV to manually reference the ID of the child resource document for the left column, is to have the child resource 'left column' automatically selected and placed within the template along with its parent document.

          Thanks.


          (PS nested lists do now work with Discuss. Or, at least, I could not make them work.)
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Create a snippet to fetch the content and any other fields desired for the resource with the current resource as parent and the name of "left-column". Put the snippet tags in the appropriate location of the template. Have some kind of default content in the case where there is no such child resource.

              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