Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-01-30 10:19:40
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
<txp:section_list> li.active not a.active
i need to get li.active for styling background image of active link like here
my current form:
<txp:section_list active_class="active" break="li" default_title="Avaleht" include_default="1" sections="rariliin,artiklid,rekordid,linnualad" wraptag="ul" />
here active class reflects for a <a> element, i need to apply to <li> element
Offline
Re: <txp:section_list> li.active not a.active
Can you not achieve that with css alone? Instead of targeting li.active a {...}
simply target li a.active {...}
.
Last edited by jakob (2009-01-30 10:26:11)
TXP Builders – finely-crafted code, design and txp
Offline
#3 2009-01-30 10:39:17
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: <txp:section_list> li.active not a.active
jakob wrote:
Can you not achieve that with css alone? Instead of targeting
li.active a {...}
simply targetli a.active {...}
.
no, because my background image composed of 2 spieces , first half goes to active li element, second to active a. the background image need to be dynamical/stretching, you see what i mean?
Offline
Re: <txp:section_list> li.active not a.active
How about this (untested):
<txp:section_list default_title="Avaleht" include_default="1" sections="rariliin,artiklid,rekordid,linnualad" wraptag="ul">
<li<txp:if_section name='<txp:section />'> class="active"</txp:if_section>><txp:section link="1" title="1" /></li>
</txp:section_list>
(based on the principle shown in Example 2 for txp:if_section).
TXP Builders – finely-crafted code, design and txp
Offline
#5 2009-01-30 13:10:55
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,308
Re: <txp:section_list> li.active not a.active
jakob wrote:
How about this (untested):
<txp:section_list default_title="Avaleht" include_default="1" sections="rariliin,artiklid,rekordid,linnualad" wraptag="ul">
<li<txp:if_section name='<txp:section />'> class="active"</txp:if_section>><txp:section link="1" title="1" /></li>
</txp:section_list>
brilliant jakob! thank you
i only needed to add break=”“
<txp:section_list break=”“…
Offline