-
☆ A M B ☆
- 24,524 Posts
First, you’ll need to become familiar with MODx terminology. You are referring to snippets and chunks. And no, there is no way to determine which pages these are used on. There are (almost) no limits to how or where they can be used; they can appear in the template, in any of the document fields, in TVs, and can even be included in the output of other snippets (and back-end plugins and modules) with $modx->getChunk() and $modx->runSnippet(). TVs are attached to templates, and can also be used in almost any context.
For example, if you have a plugin that inserts a given chunk’s content into a document during the parsing process under certain conditions (such as on a certain day of the week), how could it be determined that it’s being used by any given document, since it would be used on all of them on the specified day, and none of them on any other day? It would be convenient to have this conditional content in a chunk for easy editing, and content editors would probably be blocked by their role from editing back-end processing code like plugins and modules.
The only thing that I can suggest is to keep careful notes as you are developing the site.
-
MODX Staff
- 12,272 Posts
This would be a good idea for a JIRA request though. I think it would be possible to determine what’s used where, by first finding all the Elements (Chunks, TVs, Templates, Snippets), finding any Snippets are plugins where they’re called with things like the runSnippet API, and then finding where those Elements are used in Resources, Templates and TVs plus direct calls in Content.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
MODX Staff
- 10,725 Posts
This is neither practical nor possible, as Susan indicated. There are too many possibilities on how Elements may be called/used for this to ever be accurate.
We could provide a search of all elements and resources for a particular tag (or print a report listing each resource and element and what tags they include -- maybe with an option to display indirect tag inclusions).
It wouldn’t be perfect, but it might be a lot better than what we have now.
-
MODX Staff
- 12,272 Posts
You can do most of this now with the DocFinder module actually. Works really well in fact. Would just need some tweaking to just feed the Element names in. No wouldn’t likely ever be perfect; but if that’s the standard nothing will ever be released.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Quote from: AlfalfaAnne at Aug 31, 2009, 10:05 AM
Thanks for all the ideas - after looking in to it further, I believe I actually need to track the template variables. Sorry for the confusion over the names.
Any ideas on how I could do this or is this not doable either? 
Thank you SO much! (I’ll have another search around the forums too, armed with the correct terminology)
The problem with template variables is that they exist on all pages that use a template they are connected to, whether the page actually uses them or not. You could create a search for TV tags, but they’re identical to content tags showing things like pagtitle, longitle, etc.
You’d have to get a list of all template variable names, then search the content area of pages looking for tags that included those names. And that wouldn’t get you TVs accessed directly in snippets and plugins.