Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-06-09 10:28:02

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37

Flagging the first item in a section list???

Hi all, I have a poser for the fine minds of Txp support forum…

Is it possible to add an ID of “first” to the first list item of an unordered list generated by txp:section_list?

Thanks…

Tom


The Design Works – Freelance website designer

Offline

#2 2011-06-09 13:12:13

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: Flagging the first item in a section list???

If you need the ID for the formatting with CSS, then you don’t need it. li:first-child { … } helps.

Offline

#3 2011-06-09 13:42:00

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37

Re: Flagging the first item in a section list???

@GugUser that’s exactly what I am trying to do and it works a treat everywhere but ie6, I was just looking for a quick solution to debug that (eh-hem!) Browser.


The Design Works – Freelance website designer

Offline

#4 2011-06-09 14:02:06

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Flagging the first item in a section list???

The plugin cbs_navigation_menu effectively produces a section list which can have ids assigned to each list item. It’s best used when the list of sections is rather static in nature.

Offline

#5 2011-06-09 14:02:30

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: Flagging the first item in a section list???

Has the website user with IE6? If so, then let JavaScript, for example jQuery, set a class.

Offline

#6 2011-06-09 14:07:51

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: Flagging the first item in a section list???

joebaich schrieb:

The plugin cbs_navigation_menu effectively produces a section list which can have ids assigned to each list item. It’s best used when the list of sections is rather static in nature.

In this case, you can make a form with the static nav.

In the other case, for the first section exist <txp:if_first_section>.

Offline

#7 2011-06-10 09:25:36

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37

Re: Flagging the first item in a section list???

Thanks for you replies, I’ve had to go with a static nav this time (just to get the job done!) but I would be interested to know how this could be achieved with <txp:if_first_section> for future reference as there isn’t an example for this tag in textbook.

I’d like to steer clear of unnecessary javascript if at all possible.


The Design Works – Freelance website designer

Offline

#8 2011-06-10 10:44:48

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

Re: Flagging the first item in a section list???

inkywillow wrote:

but I would be interested to know how this could be achieved with <txp:if_first_section>

<txp:section_list wraptag="ul" break="">
   <li<txp:if_first_section> id="first"</txp:if_first_section>><txp:section title="1" link="1" /></li>
</txp:section_list>

…as there isn’t an example for this tag in textbook.

Done.

Last edited by els (2011-06-10 10:49:09)

Offline

#9 2011-06-10 10:49:56

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37

Re: Flagging the first item in a section list???

Els to the rescue again, thank you!


The Design Works – Freelance website designer

Offline

#10 2011-06-10 11:00:38

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

Re: Flagging the first item in a section list???

if_first_section. My memory, darn it. I’ve deleted my post above.


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

Offline

Board footer

Powered by FluxBB