We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13730
    • 149 Posts
    Modx 2.2.4
    PHP : 5.6.10
    MySql : 5.5.42

    I want to update some TV for a batch of resources. I installed Batcher 1.1.1, but Batcher no longer able to batch TV (https://github.com/splittingred/Batcher/issues/30).

    I have a snippet that can replace a TV value for a batch of resources.

    I am exploring another option, running my snippet via a Manager menu item.

    I try the example « Custom Manager Pages in 2.3 » in Modx documentation, no problem it working well.

    Not being too familiar with the notion of class and public function, how do I write a « Controller File » for running my snippet?

    Thank for your help


      • 3749
      • 24,544 Posts
      This probably won't work, but it's worth a try:

      Create a new menu item in System -> Menus

      Leave the action blank and use core for the namespace.

      In the handler field, put this:

      MODx.runSnippet('MySnippet'); return false;


        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
        • 13730
        • 149 Posts
        It does not work.

        This the code of the Controller File of the Modx Docs «Custom Manager Pages in 2.3» :

        <?php
        class MycmpWelcomeManagerController extends modExtraManagerController {
        public function process(array $scriptProperties = array()) {}
        public function getPageTitle() {
        return 'My Test CMP';
        }
        public function getTemplateFile() {
        return 'welcome.tpl';
        }
        }

        Is it possible to write a Controller File like this that will run my snippet?

        Thank you for your generous assistance