Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-02 03:25:26

otti
Member
From: Australia
Registered: 2008-04-16
Posts: 75
Website

Put <span> and id inside txp:section

Hi everyone,

I’m new to Textpattern but very excited about it.
I created my first navigation menu on the left of my page like this:
<ul id=“navlist”> <txp:section wraptag=“li” link=1 title=1 name=“Home” /> <txp:section wraptag=“li” link=1 title=1 name=“Books” />

</ul>

I would need to apply a <span> tag in some of the items and an a different id to all of them. Here is a working html example:
<li><a href=”#” id=“books”><span class=“booksItalicIndent”>Books</span></a></li>

How do I apply the id and the span to the list items in Textpattern?

Thanks very much for your help.

otti

Offline

#2 2008-05-02 04:30:16

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

Re: Put <span> and id inside txp:section

In example:

<li><txp:section name="books"><span>Books</span></txp:section></li>

Offline

#3 2008-05-02 08:41:17

otti
Member
From: Australia
Registered: 2008-04-16
Posts: 75
Website

Re: Put <span> and id inside txp:section

Thanks Gocom,

That worked perfectly. But how about including the id as well? The id is to show the current page in this case.

Cheers
otti

Offline

#4 2008-05-02 09:07:16

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: Put <span> and id inside txp:section

how about <a href="#" id="<txp:section />" /></a> ?

Offline

#5 2008-05-02 09:17:52

otti
Member
From: Australia
Registered: 2008-04-16
Posts: 75
Website

Re: Put <span> and id inside txp:section

Hi Sven,

That did not work. I got the span to work as per the previous answer, but I can’t work out the id with the current setup:

<li><txp:section name=“Home”>Home</txp:section></li>

Do I have to use href again? I used it before and had problems to link to the sections.

Any advice would be good.

Cheers
otti

Offline

#6 2008-05-02 10:43:17

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Put <span> and id inside txp:section

Can this be what you’re aiming at?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#7 2008-05-02 11:17:02

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Put <span> and id inside txp:section

Hello Otti. If you can’t find an appropriate solution, give a look at the ako_nav plugin. I’m using it all the time for basic nav menu, and it’s also pretty configurable (lets you insert span or not, give class and id, use class=active for actual section, etc.).

Hope this help

Z-

Offline

#8 2008-05-02 12:38:59

otti
Member
From: Australia
Registered: 2008-04-16
Posts: 75
Website

Re: Put <span> and id inside txp:section

Thanks Zanza,

That solution should do the trick.

otti

Offline

Board footer

Powered by FluxBB