Customizing the Manager Homepage

From MODx Wiki

Jump to: navigation, search


If you've ever wanted to modify the MODx Manager homepage, it's quite easy.


Contents

Custom Branding and Links

What can you add to the Manager Homepage? Here are some ideas.

  • Add links to other relevant site management portals (payment gateways, webmail, CPanel, help & support)
  • Add logos (perhaps your company's logo and your client's logo)
  • Add links to TVs, chunks, templates, or documents
  • Use a chunk to update the content regularly.


Basic How-To

Duplicate the theme

You probably first want to duplicate the theme/style that you like, like /manager/media/style/MODxLight. (Editing a duplicate of the theme directory will prevent your changes from being overwritten on future upgrades, though you'll probably want to re-duplicate anyway to make sure you have the most current manager theme.)

Methods of file editing

Method 1 - One method is to find the appropriate "welcome.html" file for the manager theme you're using, somewhere in /manager/media/style/MODxLight/welcome.html.

Method 2 - Another method is to edit the /manager/actions/welcome.static.php file and use a chunk for the content.

There is more discussion on both methods on the forums: http://modxcms.com/forums/index.php/topic,29480


Hiding the Manager Tree

This applies to editing welcome.html (Method 1). If you want to hide the tree from your users (on login), add this to the top of your welcome.html:

  1. <script type="text/javascript" charset="utf-8">
  2. // Hide the tree
  3. top.mainMenu.hideTreeFrame();
  4. </script>


Adding Links using Method 1

This applies to editing welcome.html. Add some links to what you want to do. For what I tend to do, it's adding some "Quick links" to create new documents. Here's an example with some links to create new documents under some existing parents (modify the PID values accordingly):

  1. <h3>QUICK LINKS:</h3>
  2. <ul style="padding-bottom:30px">
  3. <li><a href="/manager/index.php?a=4&amp;pid=19">Create new PR</a></li>
  4. <li><a href="/manager/index.php?a=72&amp;pid=21">Create new Media Coverage</a></li>
  5. </ul>


Adding Links using Method 2

Create a chunk called managerCode and insert your HTML content there. If you are new to HTML and need some help developing your code, use Textile or another online tool. Here is some sample HTML code that would give you several headings and links with descriptions underneath.

  1. <p><strong>Heading</strong></p>
  2. <li><a target="blank" href="http://yourlink.com">Link Title</a> &#8211; Link Description</li>
  3. <li><a target="blank" href="http://yourlink.com">Link Title</a> &#8211; Link Description</li>
  4. <li><a target="blank" href="http://yourlink.com">Link Title</a> &#8211; Link Description</li>
  5. </ul>
  6. <p><strong>Heading</strong></p>
  7. <li><a target="blank" href="http://yourlink.com">Link Title</a> &#8211; Link Description</li>
  8. <li><a target="blank" href="http://yourlink.com">Link Title</a> &#8211; Link Description</li>
  9. </ul>


Then add this section to the welcome.static.php file just above //setup message info.

  1. // setup dashboard variable
  2. $dashboard = $modx->getChunk('managerCode');


Find this section of the welcome.static.php file. One small addition of code is all that is needed. The only change is the addition of $dashboard . after the string $msg = and before the single quote mark. Note that there is a space before and after the dot.

For the end-user, this places your new management link section directly under the five main icons but over the inbox icon.

If you have trouble reading or implementing this code, go to the forum post at this link.


  1. // setup message info
  2. if($modx->hasPermission('messages')) {
  3. $msg = $dashboard . '
  4.  
  5. <br />
  6. <a href="index.php?a=10"><img src="media/style/[+theme+]/images/icons/mail_generic.gif" /></a>
  7. <span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;'.$_lang["inbox"].($_SESSION['nrnewmessages']>0 ? " (<span style='color:red'>".$_SESSION['nrnewmessages']."</span>)":"").'</span>
  8. <br />
  9. <span class="comment">'.sprintf($_lang["welcome_messages"], $_SESSION['nrtotalmessages'], "<span style='color:red;'>".$_SESSION['nrnewmessages']."</span>").'</span>';
  10. $modx->setPlaceholder('MessageInfo',$msg);
  11. }


Finding the right URLs for "Quick Links"

If you're scratching your head wondering how to find the URLs for the links: load the page as normally in the MODx manager, then (using Firefox) right click on the content area frame and say "This Frame -> Open frame in new tab". Then copy the URL from there.


Additional Notes

Still to be documented:

  • How to remove the existing set of five icons

If you'd like to add to the documentation, add to the forum post or revise this wiki page.

Personal tools