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
-
☆ 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.
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
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?
@RESOURCE loads the content field from the specified resource:
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.
Hi
Thanks for your reply. I’m not a coder, so what would the snippet be ?
Many thanks
Sorry, I could answer that for Revolution, but my Evolution chops are too rusty. Hopefully, someone else will chime in.