We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35384
    • 26 Posts
    I am new to Modx and am building my first site. I want to be able to show the same banner image on all child documents that appears in it’s parent document loaded as a template variable.

    For example. I have a parent document called "Walking" which has one template for it’s layout and it’s child pages have a different template layout but the banner image at the top on all children needs to be the same as the parent.

    I’m using Evolution 1.0.5

    Many Thanks
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Have the TV attached to both templates, and use @INHERIT as the TV’s default value. Then just edit it for the parent resources; their children will inherit the parent’s value. You can even use ManagerManager to hide the TV for the children’s template so it will only appear while editing the parent resources.
        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
        • 35384
        • 26 Posts

        Hi

        Your answers sounds exaclty what I want but I am a complete novice on Modx where do I add the @INHERIT code and does it need to reference the parent ID or will it automatically inherit from the parent? I’m a designer so coding is not normally my thing.

        Many Thanks
          • 35384
          • 26 Posts
          After you pointed me in the right direction I worked out where it goes from this website.

          http://www.gregorysmart.com/2010/04/02/modx-at-bindings-inherit/

          Thanks for your help it worked a treat !

            • 35384
            • 26 Posts
            Does anyone know if this works with @RESOURCE as well in Evolution because I can’t seem to get it to work when I try to load an image from a TV on another page?
              • 3749
              • 24,544 Posts
              @RESOURCE loads the content field from the specified resource:

              @RESOURCE 12


              If the default value of the image TV is @INHERIT, the TV tag will show the image from the nearest ancestor where the TV has a value.

              If you want to pull a TV’s value from another resource that is not an ancestor, you’d need a custom snippet.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 35384
                • 26 Posts
                Hi

                Thanks for your reply. I’m not a coder, so what would the snippet be ?

                Many thanks
                  • 3749
                  • 24,544 Posts
                  Sorry, I could answer that for Revolution, but my Evolution chops are too rusty. Hopefully, someone else will chime in.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting