Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-06 11:51:35

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Proper use of tags

Today, I read this FAQ about creating navigation. It suggests, among other things, to use this code in order to create a navigation list.

<code>
<ul>
<txp:section wraptag=“li” link=1 title=1 name=“about” />
<txp:section wraptag=“li” link=1 title=1 name=“articles” />
<txp:section wraptag=“li” link=1 title=1 name=“news” />
<txp:section wraptag=“li” link=1 title=1 name=“contact” />
</ul>
</code>

Now, perhaps I’m missing something obvious, but if I have to enter each section’s name as an attribute, why don’t I just code the navigation by hand? It’s hardly more work.

I’d appreciate anything that enlightens me on this since there are some more tags whose function I don’t understand because they contain nothing dynamic.

Offline

#2 2006-01-06 14:55:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,120
Website GitHub Mastodon Twitter

Re: Proper use of tags

this is what you need
<code><txp:section_list wraptag=“ul” break=“li” /></code> and <a href=“http://textpattern.net/wiki/index.php?title=Txp:section_list_/”>here</a> it is in the manual


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2006-01-06 15:00:36

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: Proper use of tags

Thanks colak, but I know how to achieve this effect.

It was just an example because I don’t understand why you would use, e.g., the tag <txp:section name="about" /> instead of just writing “about”.

Offline

#4 2006-01-06 15:44:52

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Proper use of tags

It’s not the only strange tag doing strange things :)

Offline

#5 2006-01-06 16:28:21

tinyfly
Member
From: Dallas, Texas
Registered: 2004-05-10
Posts: 462
Website

Re: Proper use of tags

I am grasping here but maybe if you wanted to change your section title in txp’s sections tab then it would dynamically update your navigation. Using section_list does not usually work for me because I often have a section that I don’t want outputed in my main navigation.

Offline

#6 2006-01-07 02:41:48

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Proper use of tags

Now, perhaps I’m missing something obvious, but if I have to enter each section’s name as an attribute, why don’t I just code the navigation by hand? It’s hardly more work.

In case you change the name of a section, move your site, etc.


Alex

Offline

#7 2006-01-07 08:00:23

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: Proper use of tags

Ok, I see. I had thought of that but wasn’t sure if there was some other advantage I didn’t realise. Thanks, zem.

Offline

Board footer

Powered by FluxBB