Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-06-29 01:23:18

shilmy
Member
Registered: 2006-04-29
Posts: 49

CSS for Navigation Menu

Hello,

I intend to use a template “Keep It Simple” from StyleShout.com for my next textpattern site, you can see the template here:

http://www.styleshout.com/templates/preview/KeepItSimple1-0/index.html

In doing so, I need help on how to create the navigation bar,

from the template, here is the navigation code:

<div id="nav">
   <ul>
         <li id="current"><a href="index.html">Home</a></li> 
         <li><a href="style.html">Style Demo</a></li>
         <li><a href="blog.html">Blog</a></li> 
         <li><a href="index.html">Services</a></li>
         <li><a href="index.html">Support</a></li> 
         <li><a href="index.html">About</a></li>
   </ul>
</div>

In textpattern, I use cbs_navgation_menu plugin to create the navigation code, here is the code:

<div  id="nav">
    <txp:cbs_navigation_menu break="li" wraptag="ul" activeclass="current" sections="default,style,blog,services,support,about" titles="Home,Style Demo,Blog, Services,Support,About" />
</div>	

Here is the rendering results for the code above:

<div id="nav">
   <ul>
         <li><a href="http://www.domain.com/" class="current">Home</a></li> 
         <li><a href="http://www.domain.com/style/">Style Demo</a></li>
         <li><a href="http://www.domain.com/blog/">Blog</a></li> 
         <li><a href="http://www.domain.com/services/">Services</a></li>
         <li><a href="http://www.domain.com/support/">Support</a></li> 
         <li><a href="http://www.domain.com/about/">About</a></li>
   </ul>
</div>

The different is id=“current” in the template, and class=“current” in the rendering textpattern, and the results is not what I expected, because current section is not highlighted.

So,can anyone help me to achieve the proper code to imitate the template?

Thanks,
Sjarief

Last edited by shilmy (2009-06-29 01:33:49)

Offline

#2 2009-06-29 04:52:26

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: CSS for Navigation Menu

With inbuild tags:

<ul>
	<txp:section_list sections="style,blog,services,support,about" include_default="1" default_title="Home" break="">
		<li<txp:if_section name='<txp:section />'> id="current"</txp:if_section>>
			<txp:section link="1" title="1" />
		</li>
	</txp:section_list>
</ul>

See:

Last edited by Gocom (2009-06-29 04:55:04)

Offline

#3 2009-06-29 09:00:38

shilmy
Member
Registered: 2006-04-29
Posts: 49

Re: CSS for Navigation Menu

Thanks, it work great without plugin…

Offline

Board footer

Powered by FluxBB