Does anyone know of a way to detect a parent template?
I'm trying to setup the back-end so if a client creates a resource with the template "Category" anywhere on the site then all of its children will inherit the template called "Sub-Category".
Something like [[+parent-template]] to be used as a constraint field for Form Customisations would be useful.
I've read
this blog post by Greg Smart and
this forum post. But they both rely on knowing the ID or knowing the level within the resource tree.
MODX Ambassador for Thailand. Managing Director at
Monogon, a web design and development studio based in Bangkok, Thailand. -
Follow me on Twitter.
-
- 1,098 Posts
I tried to do something similar with "ChangeTemplate" plugin, with a template variabile with default value already set up, and also with Form Customization, but no luck with that.
My idea was to use the template variabile of "ChangeTemplate" plugin with "default value" set to the template I wanted to inherit, but for some reason it didn't work, then I tried to use Form Customization to put a "default value" to the template variable of "ChangeTemplate", but again, no luck. I don't know why!
-
- 24,544 Posts
Would this work for you?
http://modx.com/extras/package/inheritselectedtemplate
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODX info for everyone:
http://bobsguides.com/modx.html
-
- 1,098 Posts
That's for MODX Evolution, does it work on Revolution?
-
- 24,544 Posts
Oops, I thought I was looking at Revo extras. I don't think it will work on Revo without modification.
---------------------------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
MODX info for everyone:
http://bobsguides.com/modx.html