We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10473
    • 44 Posts
    I had a look around and I cannot find an answer anywhere, so here’s my problem:

    We have a site which has too many modules to display in the green toolbar, and so the ones we have just added are outside the browser window, even when the browser is maximised.

    How can we run those modules?

    Also, some manager users do not have access to the manage modules option and so cannot run the modules from within this section.

    Is there any way of paging the modules tab, or in some other way running the modules that have disappeared off to the right?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Any user that has "run modules" permissions can access the Modules section from the Manager "home" page.

      You could create a module with links to all your modules, just use index.php?a=112&id=moduleId for the links.
        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
        • 10473
        • 44 Posts
        If we were to create a module to execute the other modules, then it would be more user friendly to have only that module displayed in the modules menu. Is this possible?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Only if you hacked the main menu to only display that one module instead of reading the modules table of the database. Starting at line 263 of manager/frames/menu.php
          // Modules Menu Items
          $modulemenu = array();
          if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
          	// manage-modules
          	$modulemenu[] = '<li><a onclick="this.blur();" href="index.php?a=106" target="main">'.$_lang['module_management'].'</a></li>';
          }
          if($modx->hasPermission('exec_module')) {
          	// Each module
          	if ($_SESSION['mgrRole'] != 1) {
          		// Display only those modules the user can execute
          		//$rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, mg.member
          		//		FROM '.$modx->getFullTableName('site_modules').' AS sm
          		//		LEFT JOIN '.$modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id
          		//		LEFT JOIN '.$modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group
          		//		WHERE (mg.member IS NULL OR mg.member = '.$modx->getLoginUserID().') AND sm.disabled != 1');
          	//} else {
          		// Admins get the entire list
          	//	$rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1');
          	//}
          	//while ($content = $modx->db->getRow($rs)) {
          	//	$modulemenu[] = '<li><a onclick="this.blur();" href="index.php?a=112&id='.$content['id'].'" target="main">'.$content['name'].'</a></li>';
          	//}
                 	$modulemenu[] = '<li><a onclick="this.blur();" href="index.php?a=112&id=??" 
          target="main">ModuleName</a></li>';
          }
          

          Replace the whole query and loop generating the links with just the one link with the id (??) hard-coded.

          Keep in mind that you’d need to keep a note of this to hack the same file again for an upgrade.

          You could also modify the "welcome.static.php" file to have the Modules icon on the Manager home page be a link to your module with the list of modules to run; that would be friendlier to your users.
            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
            • 10473
            • 44 Posts
            Thanks, I think I’ll go for the menu editing option, and then paste the commented out code in the meta module.