title: Adding Anchor to every module in Joomla 3.1
body: <p>I am trying to modify the module template code to add an anchor to the title of each module.  I have extremely limited PHP knowledge, so any guidance would be very helpful.</p>
  
  <p>I've found posts for doing this with articles, but the code appears to be very different for modules.</p>
  
  <p>This is the code that is in my module template.</p>
  
  <pre><code>function modChrome_basic($module, &amp;$params, &amp;$attribs)
  {
  if (!empty ($module-&gt;content)) : ?&gt;
      &lt;?php echo $module-&gt;content; ?&gt;
  &lt;?php endif;
  }
  
  function modChrome_standard($module, &amp;$params, &amp;$attribs)
  {
  if (!empty ($module-&gt;content)) : ?&gt;
         &lt;div class="rt-block &lt;?php if ($params-&gt;get('moduleclass_sfx')!='') : ?&gt;&lt;?php echo              $params-&gt;get('moduleclass_sfx'); ?&gt;&lt;?php endif; ?&gt;"&gt;
          &lt;div class="module-surround"&gt;
              &lt;?php if ($module-&gt;showtitle != 0) : ?&gt;
          &lt;div class="module-title"&gt;
                  &lt;?php 
                  echo '&lt;h2 class="title"&gt;';
                      if (preg_match("/icon[-]{1,}/i", $params-&gt;get('moduleclass_sfx'))) : 
                          echo '&lt;span class="title-icon ' .getIconClass($params-&gt;get('moduleclass_sfx')). '"&gt;&lt;/span&gt;';
                      endif;
                      echo $module-&gt;title;
                  echo '&lt;/h2&gt;';
                  ?&gt;
          &lt;/div&gt;
                      &lt;?php endif; ?&gt;
                      &lt;div class="module-content"&gt;
                          &lt;?php echo $module-&gt;content; ?&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
         &lt;/div&gt;
  &lt;?php endif;
  </code></pre>
  
  <p>}
  This is the code I tried </p>
  
  <pre><code>if( strlen($this-&gt;item-&gt;params-&gt;get('title')) &gt; 0 ) { 
      echo '&lt;a name="'.$this-&gt;item-&gt;params-&gt;get('title').'"&gt;&lt;/a&gt;'; 
  }
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code> if( strlen($module-&gt;item-&gt;params-&gt;get('title')) &gt; 0 ) { 
       echo '&lt;a name="'.$module-&gt;item-&gt;params-&gt;get('title').'"&gt;&lt;/a&gt;'; 
  } 
  </code></pre>