title: What is the proper way to add a custom dashboard "box" in the Magento backend without editing default templates?
body: <p>I am working on creating what I hope one day will be a publicly available Magento extension (this part I mention because it's important to me that I do the "right thing" here). One of the things I would like to do is add a box in the default Magento dashboard, basically a new "box" exactly like "Top 5 Search Terms" except with my own content. I would like my new custom box to be the last box that is displayed (ideally). </p>
  
  <p>The issue that I'm running into is that the template that is responsible for rendering the dashboard calls out specific blocks to be rendered, and these blocks are nested inside of html. In other words, where often there is an area where child blocks will be rendered into a nice reasonable HTML element, in this situation it appears that specific blocks are rendered. Here is the contents of <strong>/app/design/adminhtml/default/default/template/dashboard/index.phtml</strong></p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>  &lt;div class="dashboard-container"&gt;
              &lt;?php echo $this-&gt;getChildHtml('store_switcher') ?&gt;
              &lt;table cellspacing="25" width="100%"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;?php echo $this-&gt;getChildHtml('sales') ?&gt;
                          &lt;div class="entry-edit"&gt;
                              &lt;div class="entry-edit-head"&gt;&lt;h4&gt;&lt;?php echo $this-&gt;__('Last 5 Orders') ?&gt;&lt;/h4&gt;&lt;/div&gt;
                              &lt;fieldset class="np"&gt;&lt;?php echo $this-&gt;getChildHtml('lastOrders'); ?&gt;&lt;/fieldset&gt;
                          &lt;/div&gt;
                          &lt;div class="entry-edit"&gt;
                              &lt;div class="entry-edit-head"&gt;&lt;h4&gt;&lt;?php echo $this-&gt;__('Last 5 Search Terms') ?&gt;&lt;/h4&gt;&lt;/div&gt;
                              &lt;fieldset class="np"&gt;&lt;?php echo $this-&gt;getChildHtml('lastSearches'); ?&gt;&lt;/fieldset&gt;
                          &lt;/div&gt;
                          &lt;div class="entry-edit"&gt;
                              &lt;div class="entry-edit-head"&gt;&lt;h4&gt;&lt;?php echo $this-&gt;__('Top 5 Search Terms') ?&gt;&lt;/h4&gt;&lt;/div&gt;
                              &lt;fieldset class="np"&gt;&lt;?php echo $this-&gt;getChildHtml('topSearches'); ?&gt;&lt;/fieldset&gt;
                          &lt;/div&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;div class="entry-edit" style="border:1px solid #ccc;"&gt;
                              &lt;?php echo $this-&gt;getChildHtml('diagrams') ?&gt;
                              &lt;?php if (is_array($this-&gt;getChild('diagrams')-&gt;getTabsIds())) : ?&gt;
                                  &lt;div id="diagram_tab_content"&gt;&lt;/div&gt;
                              &lt;?php endif; ?&gt;
                              &lt;div style="margin:20px;"&gt;
                                  &lt;?php echo $this-&gt;getChildHtml('totals') ?&gt;
                              &lt;/div&gt;
                              &lt;div style="margin:20px;"&gt;
                                  &lt;?php echo $this-&gt;getChildHtml('grids') ?&gt;
                                  &lt;div id="grid_tab_content"&gt;&lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>If I was doing this in my own store, I believe I could achieve this relatively easily by editing the base Magento dashboard template index.phtml above, add what I need to have my block render, something like:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;div class="entry-edit"&gt;
       &lt;div class="entry-edit-head"&gt;
           &lt;h4&gt;&lt;?php echo $this-&gt;__('Top 5 Search Terms') ?&gt;&lt;/h4&gt;&lt;/div&gt;
           &lt;fieldset class="np"&gt;&lt;?php echo $this-&gt;getChildHtml('myDashboardBox'); ?&gt;&lt;/fieldset&gt;
       &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>But, this isn't my own store, so this doesn't really seem like an option.</p>
  
  <p>Now, after some thought my options seem to be as follows (note that most of these seem "bad" and not something I'd be super proud to have seen in the public):</p>
  
  <p>0) Something obvious that I'm not seeing that you will tell me is the perfect/right solution</p>
  
  <p>1) I might (maybe?) be able to add my custom block inside of one of these other blocks in this area ("topSearches", "sales", etc) and have my block rendered. This does not seem very "clean"</p>
  
  <p>2) I might be able to have the block rendered somewhere else on the dashboard page, and then move it with javascript to the correct place. This would be fairly easy I'm guessing, but feels very "hacky" for obvious reasons. </p>
  
  <p>Does anybody have any feedback on the way to do this, or IF there is a way? Keep in mind that again I would like to release this module publicly so my goal is to do a good job and do as little "hacking" as possible. </p>
  
  <p>Thank you very much for reading!</p>