Hi all,
is there any way to control which TVs are visible for editing in the manager according to the container folder?
for example I have several sections on the site and each has it’s own TVs; right now the user needs to scroll inside all the TVs and find those that needed in that section. What I want to do is that under container named ’cars’ I’ll only see TVs I choose related to cars and not also TV’s related to ’fruits’.
is that possible?
-
MODX Staff
- 10,725 Posts
Just make your head section a TV that appears on all your templates and problem solved, right?
And dev_cw, your idea of variables free of template dependency is in development as we speak; it will be known as ResourceElements, and it will allow you to relate just about any kind of element (snippet, chunk, tv, etc.) directly to a resource. This will not be in the initial release of the re-engineered core, but will be one of the first additional features that gets added once a stable release is achieved.
This may help with dealing with the head section of each page.
Instead of adding your html in the actual template definition I used the includeFile snippet linked to various php files in the templates\templatename\ directory. The bonus is you can then code your template using standard php include/partial methodology.
I agree with dev_cw, just hoping that 0.9.7 will allow more scope to template variables as I’ve had instances were I needed to define "global" template variables that didn’t need to be set on a per page basis.
-
MODX Staff
- 10,725 Posts
Great tip Marschant.
BTW, you can approximate template variables without the "template scope" as you refer to it, simply using snippets and/or plugins + placeholders. Just create a snippet to include directly in a template that sets a placeholder, or create a plugin that does the same. Then you can use that placeholder just like you would a TV, minus the output widgets and manager input features; but those could be easily managed via a module, a separate protected front-end page, etc.