We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32830
    • 21 Posts
    I know I can use [*pagetitle*] to grab the name of the current page.

    But how do I output the name of the container that envelops the current page?
    My site is organized by "projects" so I want to put the name of the project at the top of each sub page.

    For example: Container (and project) Name = "Build a Workbench For Your Garage"
    Inside that container is 4 subpages: 1.) Bill of Materials, 2.) Tools You’ll Need, 3.) Instructions, 4.) Finished Pics

    On each of the subpages, I want the words "Build a Workbench For Your Garage" to appear.
    How do I get that title without hardcoding it?

    Thanks for any suggestions,
    Ned
      • 11975
      • 2,542 Posts
      Hi,

      The getField Snippet is the tool to use in your case.
      You will find it in the repository.

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 32830
        • 21 Posts
        Cool. I’ll look into it. Thanks!
          • 32830
          • 21 Posts
          Brilliant! It seems like it was made for just this application.
          Now I can ditch the custom TV which required the editor to enter the parent project name for every new page.

          The hardest part was figuring out how to download getField - which wasn’t so hard.

          For fellow newbs:
          See Repository: http://www.modxcms.com/resources.html
          Get Field: http://www.modxcms.com/getField-1.2-0.html
          The Document Object: http://modxcms.com/the-document-object.html

          Add getField as a snippet.
          Call it like this, (adjust to taste)...
          [!getField? &parent=`1` &parentLevel=`1`!]