-
MODX Staff
- 12,272 Posts
Cipa, just to be clear, could this function exactly as an enhanced replacement for Inherit Parent Template? If so it’d be a wonderful bit to update for the Core distribution.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
yes
it can be done.
But I personally think that there are a couple of things that need to be implemented.
1. When a container uses this functionality and the dropdown is limited to the defined templates and a document is using a different one, when saving the document the template will change because it’s not in the configured list. This can be easily achieved.
2. we can expand the limit template list functionality to the root container/documents.
An additional TV will be needed or we can use the same but the syntax will be a bit more complicated.
Using an additional TV we can define a simple list of of ids: 14,15. When you edit the root container only these templates will be visible in the dropdown.
3. permissions for different groups - not needed as you can hide TVs with modx
Any other ideas are welcomed.
1. You can teach your client to use Document Manager. You can pass a list of ids and change the template for all of them.
2. You have to built a plugin that is based on Templates Rules + some customization.
Here’s how I think you should do it:
a. create a new TV called: stickyTemplate (or similar) - This should be Yes/no probably a checkbox
b. Apply it to the container
c. extend Template Manager to something like
case ’OnLoadWebDocument’:
if the parent has stickyTemplate to yes
get the template id of the parent
get the template
$modx->documentContent = the above template;
break;
If you want that when you edit a child the template is Blue instead of the default Red you should modify a bit the Template Rules Plugin to detect the sticky TV value and output the appropriate value for ’OnDocFormRender’ event
When im on my projects page it says Uses Template: "Projects" instead of "Project Details" and I went through the installation instructions about 4 times very slowly so im not sure what to do.. I have the "Template Rules" field at the bottom of the "Projects" page and put in "10" which is my "Project Details" template.. what else could it be?
Hi BnH,
I’m using this plugin on at least 5 projects and I do not have a problem with it. I’m not sure what is happening but I could have look if you send me a user name and pass to login into your modx install.