title: Make link active in tpl file for Prestashop header links
body: <p>I'm trying to edit the following code in tmheaderlinks.tpl in my Prestashop installation so that when "About Us" is clicked it will become "active" as do the other links:</p>
  
  <pre><code>&lt;ul id="header_links"&gt;
  &lt;li&gt;&lt;a href="{$link-&gt;getPageLink('index.php')}"{if $page_name == 'index'} class="active"{/if}&gt;{l s='home' mod='tmheaderlinks'}&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="{$link-&gt;getPageLink('prices-drop.php')}"{if $page_name == 'prices-drop'} class="active"{/if}&gt;{l s='specials' mod='tmheaderlinks'}&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="{$link-&gt;getPageLink('contact-form.php')}"{if $page_name == 'contact-form'} class="active"{/if}&gt;{l s='contact' mod='tmheaderlinks'}&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="{$link-&gt;getPageLink('cms.php?id_cms=14')}"{if $page_name == 'about-us'} class="active"{/if}&gt;{l s='About Us' mod='tmheaderlinks'}&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p></p>
  
  
  
  <p>The variable $page_name in Prestashop is set using the id of the page, and because the About Us page is sourced from the CMS feature of Prestashop, the id is set to 'cms' which isn't very useful because it would make the link active for all pages displayed from the CMS.</p>
  
  <p>Is there a variable I can use that can replace the $page_name variable for the About Us entry? Or is there a way of testing for the Page Title instead of name and then setting the class as active?</p>
  
  <p>Or can I assign the $page_name variable to a specific value (about-us) for the About Us page in the CMS?</p>
  
  <p>I've seen a couple of solutions that came close on Prestashops forums, but not quite:</p>
  
  <p><a href="http://www.prestashop.com/forums/topic/139344-css-active-in-cms-pages/" rel="nofollow">http://www.prestashop.com/forums/topic/139344-css-active-in-cms-pages/</a></p>
  
  <p>Any help would be very much appreciated!</p>
  
  <p>EDIT: I solved this myself (God knows how!) buy using this line:</p>
  
  <pre><code>    &lt;li&gt;&lt;a href="{$link-&gt;getPageLink('cms.php?id_cms=14')}"{if {$smarty.server.REQUEST_URI} == '/content/14-about-us'} class="active"{/if}&gt;{l s='About Us' mod='tmheaderlinks'}&lt;/a&gt;&lt;/li&gt;
  </code></pre>
  
  <p>Bear in mind you'll need to change the '/content/14-about-us' to whatever your URI is from your installation. Not the best fix, but it works.</p>
  
  <p>Hope that helps someone!</p>