variable inside {selected_xx}
Posted: 12 July 2007 01:29 PM   [ Ignore ]
Administrator
Rank
Total Posts:  12
Joined  2007-06-27

good day:

i whas wondering how to acomplish this:

<ul class="domtabs">
{exp:yearly_archives weblog="arco_bonaire" start_month="1" status="not closed" sort="desc" start_year="2005"}
{exp
:selected item="{segment_2}" replace="class='active'"}
<li {selected_{year}}><a href="#y{year_short}" title="view archive of {year}">{year}</a></li>
{/exp:selected}
{
/exp:yearly_archives}
</ul>

As you see:

<li {selected_{year}}>

will not work
is there another solution to get the {year} contents into the {selected_xx} variable ?
maybe some php ?

 Signature 
Profile
 
 
Posted: 13 July 2007 01:23 AM   [ Ignore ]   [ # 1 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  336
Joined  2005-07-09

The problem is that {year} (A variable provided by the yearly_archives plugin, I suppose?) is not available to {exp:selected} at parse time. By default, when nesting plugins, the inner ones are parsed first. You can try to change the order of plugins, or perhaps use the parse parameter. Try this:

{exp:yearly_archives weblog="arco_bonaire" start_month="1" status="not closed" sort="desc" start_year="2005" parse="inward"}
{exp
:selected item="{segment_2}" replace="class='active'"}
<li {selected_{year}}><a href="#y{year_short}" title="view archive of {year}">{year}</a></li>
{/exp:selected}
{
/exp:yearly_archives}
</ul>

 Signature 

Ingmar Greil

Profile