Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-05-07 00:36:55

scdoody
Member
Registered: 2006-10-18
Posts: 129

Changing order of sections in a list

I have a section list for navigation – but, I want to change the order the sections are listed in – currently they are listed in alphabetical order:

<txp:section_list active_class=“globalnav-on” break=“li” class=“globalnav” include_default=“0” wraptag=“ul” />

Also, this code generates:

<ul class=“globalnav”>
<li>secton a</li>
<li>secton b</li>
<li>secton c</li>
<li>secton d</li>
</ul>

But – I want to be able to add onmouseover and onmouseout events to the li elements in order to change the color of the background of the li on rollover – how would I do this. I know the CSS, I just need to know where to add this to the above textpattern code.

Thanks!!!

Offline

#2 2007-05-07 06:30:30

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Changing order of sections in a list

You don’t have to do anything to the html. Just use the “hover” selector in the CSS like this…

globalnav li a{
background:red;
}

globalnav li a:hover{
background:blue;
}

You can also designate different strings for section “name” and “title” to affect sort order. like this…

  • Section names “01-home”, “02-about”
  • Section titles “home”, “about”

This will make “home” display before “about”.

Last edited by mrdale (2007-05-07 06:30:46)

Offline

#3 2007-05-14 01:57:45

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: Changing order of sections in a list

mrdale wrote:

You can also designate different strings for section “name” and “title” to affect sort order. like this…
Section names “01-home”, “02-about”
Section titles “home”, “about”

Nice Tip! Thanks Dale.

Cheers,
Tom

Offline

Board footer

Powered by FluxBB