Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
I would like my main menu buttons to use css to mark them as active when a visitor is on that page.
Using cloneable pages I have used
Code: Select all
 <li class="<cms:if k_page_title=='Pricing'>active</cms:if>"><a href="page.php?p=14">Prices</a></li>

Which works well
However where I have a standalone page it does not seem to work,
for example using
Code: Select all
 <li class="<cms:if k_page_title=='FAQ'>active</cms:if>"><a href="faq.php">FAQ</a></li>

My Couch code for this page is
Code: Select all
<?php require_once( 'cms/cms.php' ); ?>
<cms:template title='faq' order='1'>
   <cms:editable name='page_title' label='Page Title' type='textarea' height='75' group='group_seo' />
   <cms:editable name='group_seo' label='Search Engine Optimization' type='group' />
   <cms:editable name='meta_description' label='Meta Description' type='textarea' height='75' group='group_seo' />
   <cms:editable name='meta_keywords' label='Meta Keywords' type='textarea' height='75' group='group_seo' />
<cms:repeatable name='faq' order='7' >
   <cms:editable type='nicedit' label='number' name='number' />
   <cms:editable type='nicedit' label='question' name='question' />
   <cms:editable type='nicedit' label='answer' name='answer' />

So my question is, What do I need to add to the couch code to make
Code: Select all
if k_page_title=='FAQ'
be recognised?

Please test for the template name instead e.g. as follows -
Code: Select all
<li class="<cms:if k_template_name=='faq.php'>active</cms:if>"><a href="faq.php">FAQ</a></li>

Hope this helps.
Perfect, thanks again.
3 posts Page 1 of 1

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 3 guests