Forrest Developers,
I am using a modified pelt skin on a forrest site, and would prefer that
menus are "open" by default upon entry into a tabbed pane,
rather than closed as is the case for all but the current site in the
default skin.
A more complete (and more attractive to me) option is described by Clay
Leeds in FOR-339
(
http://issues.apache.org/jira/browse/FOR-339).
I have hacked a solution to the problem I first defined for myself by
modifying the
"innermenuli
" template in site2xhtml.xsl of the pelt variant I am maintaining,
to change the way the variable "tagid" is populated in that
template. The code is shown below my signature.
If the variable I've called "menu-state-default" were, instead,
a value taken from an (inheritable) attribute of nodes of site.xml, as
FOR-339 suggests, I think that this would be a much more interesting and
useful contribution to Forrest.
However, after spending some time looking into how an attribute such as
the one described in FOR-339 (display="none|block") might be
preserved through the pipleline to be included in the input to
site2xhtml.xsl I found myself in over my head.
I may be able to put some time into implementing a solution to FOR-339
but would need some help vis-a-vis how & by what stylesheets site.xml
is transformed to the input to site2xhtml.xsl, and what would be an
appropriate point to alter that pipeline. Before putting any more
time into it I'd also like to know whether the Forrest developers believe
this would be a useful contribution to the project.
Thanks,
Steve Masover
+++++++++++++++++++++++++++++++++++++
<xsl:template
name=
"innermenuli"
>
<xsl:param
name=
"id"
/>
<!--
Menu Default: Open vs Closed
if value of menu-state-default is 'open',
all menu-sections will default to open on
entering into tabbed pane;
otherwise, user must click to open desired
menu-sections
-->
<xsl:variable
name=
"menu-state-default"
select=
"'open'"
/>
<xsl:variable
name=
"tagid"
>
<xsl:choose>
<xsl:when
test=
"$menu-state-default='open'"
>
<xsl:value-of
select=
"concat('menu_selected_',$id)"
/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when
test=
"descendant-or-self::node()/li/div/@class='current'"
>
<xsl:value-of
select=
"concat('menu_selected_',$id)"
/>
</xsl:when>
<xsl:otherwise><xsl:value-of
select=
"concat('menu_',concat(font,$id))"
/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--
original pelt skin tagid variable follows:
-->
<!--
<xsl:variable name="tagid">
<xsl:choose>
<xsl:when
test="descendant-or-self::node()/li/div/@class='current'"><xsl:value-of
select="concat('menu_selected_',$id)"/></xsl:when>
<xsl:otherwise><xsl:value-of
select="concat('menu_',concat(font,$id))"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
-->
[...]
+++++++++++++++++++++++++++++++++++++
- Menu display defaults (as in FOR-339) Steve Masover
- Re: Menu display defaults (as in FOR-339) Thorsten Scherler