We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1069
    • 4 Posts
    Sorry if this is posted in the wrong place. smiley Not sure if there is an easy way to do this (otherwise I’ll be heading to the Bounty section and see if I can get anyone to do this quickly), but is there a way to see which pages a module is assigned to? Currently the only way I know how to do this is to go into the admin and check each page to see which modules are selected.

    sidenote: I know in Joomla, you can see which pages the modules are on, but I can’t find that info in MODx.

    Sorry if this is a total noob question. Appreciate your patience!

    Thanks in advance!
      • 28042 ☆ 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.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 25663 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
          • 22303 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.
            • 3749
            • 24,544 Posts
            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.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 25663 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
                • 1069
                • 4 Posts
                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? undecided

                Thank you SO much! (I’ll have another search around the forums too, armed with the correct terminology)
                  • 3749
                  • 24,544 Posts
                  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? undecided

                  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.

                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting