Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-10-05 13:32:54

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 580

Produce a Navigation Bar using txp:section_list and txp:linklist

I’m trying to produce a suckerfish type menu using txp:section_list and txp:linklist tags. I’ve managed to get the the code below working but I’m having some difficulty in the txp:linklist tags to work (see the 2nd batch of code).

Does anyone have some pointers to get me moving in the right direction please?

Thanks.


<ul id="nav">
		<!-- Home -->
		<li><a href="<txp:site_url />" class="nav-bar whiteNav">Home</a></li>

		<!-- Contact -->
		<li><a href="#" class="nav-bar whiteNav">Contact</a></li>

		<!-- Projects -->
		<li><a href="#" class="nav-bar whiteNav">Projects</a>
			<ul>
				<txp:linklist class="menu-links" category="projects" wraptag="li" />
			</ul>
		</li>

		<!-- Tutorials -->
		<li><a href="#" class="nav-bar whiteNav">Tutorials</a>
			<ul>
				<txp:linklist class="menu-links" category="tutorials" wraptag="li" />
			</ul>
		</li>
	</ul>

.


<!-- Home -->
<li><a href="<txp:site_url />" class="nav-bar whiteNav">Home</a></li>

<!-- Contact -->
<txp:section_list sections="contact" wraptag="li" break="" class="nav-bar whiteNav" />

<!-- Projects -->
<txp:section_list sections="projects" wraptag="li" break="" class="nav-bar whiteNav">
<li><txp:linklist class="menu-links" category="projects" wraptag="ul" /></li>
</txp:section_list>

Last edited by Algaris (2010-10-05 13:33:50)

Offline

#2 2010-10-05 14:14:21

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Produce a Navigation Bar using txp:section_list and txp:linklist

Can you give an example of what the output should be?

Offline

#3 2010-10-05 14:45:31

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 580

Re: Produce a Navigation Bar using txp:section_list and txp:linklist

In a nutshell I’m trying to recreate this: http://htmldog.com/articles/suckerfish/dropdowns/ using TXP tags to link to Sections for the menus and TXP Links for the menu items.

This is what the menu bar should look like styled:

Apart from the home link the other menu items need to be output using <txp:section_list /> The sub items in the menu are texpattern links and need to be output using <txp:linklist category="xyz"/>

Last edited by Algaris (2010-10-05 14:45:59)

Offline

#4 2010-10-05 15:20:19

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Produce a Navigation Bar using txp:section_list and txp:linklist

Something like this?

<ul id="nav">

<txp:section_list sections=",contact" include_default="1" default_title="Home" break="li">
   <txp:section title="1" link="1" class="nav-bar whiteNav" />
</txp:section_list>

<txp:section_list sections="projects,tutorials" break="li">
   <txp:section title="1" link="1" class="nav-bar whiteNav" />
   <txp:linklist wraptag="ul" break="li" class="menu-links" category='<txp:section />'>
      <txp:link />
   </txp:linklist>
</txp:section_list>

</ul>

Offline

#5 2010-10-05 15:38:40

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 580

Re: Produce a Navigation Bar using txp:section_list and txp:linklist

Thank you. I don’t have time to try it now but I’ll have look tomorrow and let you know how it goes.

Thanks again.

—Edit—

That worked perfectly. Thank you so much!

Last edited by Algaris (2010-10-06 08:16:07)

Offline

Board footer

Powered by FluxBB