We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    Specifically, I want to customize the search page in the manager (i.e. the one that appears under Site --> Site Search @ manager/?a=54). Or how about the one to view the manager logs?

    These are both forms generated by Ext JS... so we should be able to add some JS and add another field or change the layout. Is this possible? There isn't a System Event specific to each manager action, but is there some other way to load up JS just on a specific page request?

    Or... how about moving the related JS files into the MODX manager template? That way you could create a new template and easily override the existing JS.

    Anyone done this?
      • 3749
      • 24,544 Posts
      I haven't done it, but it might work to use a plugin connected to OnManagerPageInit that checked the action and injected the JS if the action is the search page.

      In my install, that would be:

      if ($_GET['a'] == 47)


      I think more correctly it would something like one of these (but I'm guessing):

      if ($_GET['a'] == $modx->action['site/search'])



      if ($scriptProperties['action'] == $modx->action['site/search'])



      The search Tpl is just this:

      <div id="modx-panel-search-div"></div>


      so modifying that isn't an option.

      The JS is injected in this file:

      manager\controllers\default\search.class.php
        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