title: Linking to Categories Joomla
body: <p>I'm creating a module for joomla 2.5. With it i need to create links to joomla categories</p>
  
  <p>At the moment I am doing it like this:</p>
  
  <pre><code>$link = "index.php?option=com_content&amp;view=category&amp;id=".$cat-&gt;id;
  </code></pre>
  
  <p>This works, but I want to use the SEF URL's that joomla gives to each category.  Ie:</p>
  
  <p><em>http;//www.website.co.uk/category/</em></p>
  
  <p>Our website never shows more than one step in the URL so if the structure is: Cat1->Cat2->Cat3</p>
  
  <p>The URL will only show: <em>http;//www.website.co.uk/Cat3/</em></p>
  
  <pre><code>$link = JRoute::_("index.php?option=com_content&amp;view=category&amp;id=".$cat-&gt;id);
  </code></pre>
  
  <p>only results in a link to the home page.  How can I get it to link to the category?</p>