Is there a way for document to inherit/contamine properties in ModX? I’m currently creating a website for an art project (see my profile), using ModX 9.6.1 and I’m looking for a clean way to do the following things :
- There are two "special pages", which are "agenda" and "blog". I need _all_ descendants of these pages to be displayed using a certain template (which is not the template for the "agenda" and "blog" pages, but only for their descendants), regardless of their setup. I would like to get not only a static, automated copy-paste like reproduction of the page’s parameters, but really have the possibility for a parent page to set parameters for all its children.
- Some pages, like some projects page, blog and agenda pages, needs to be displayed with a second menu. I’ve simply created a template variables for this, but it of course does not work on descendant pages.
If thought about parsing the "genealogy" for each page display, but I’m afraid this will create too much SQL requests. Maybe there’s an object (I haven’t found yet ^^) in ModX containing the whole ancestors’ hierarchy of the current document ?
My english is anything but perfect, so don’t hesitate to ask if there’s something which isn’t clear ^^
Regards
teh boï
teh bo
-
☆ A M B ☆
- 24,524 Posts
If you use @INHERIT as the default value for the TV, then set it to the desired value for the parent, all of the children will inherit the parent’s value.