Re: Submenus
Matthias Dieke <[email protected]>
| Newsgroups | gmane.comp.cms.bitflux.general |
|---|---|
| Message-ID | <[email protected]> |
Simon Rönnqvist wrote:
> Hi!
>
> I guess your XSL could be useful... but I just found a little flaw
> which should be corrected.
>
> It's not correct to nest an <ul> directly inside of an <ul>, the nested
> <ul> needs to be nested inside of an <li> just like in my example.
> http://validator.w3.org/check?verbose=1&uri=http%3A//
> www.nordicwalking-kiel.de/wissenswertes/
Oh, not so good ;) It is possible that is a problem for all Flux CMS
based sites...
http://validator.w3.org/check?verbose=1&uri=http://www.bitflux.ch/produkte/cms/
Also have some problems with "ul" and "li" :(
Here is my xsl-stuff for the navigation:
<xsl:template name="leftnavi">
<ul>
<xsl:for-each
select="$navitreePlugin/collection/items/collection[display-order > 0]">
<xsl:sort select="display-order" order="ascending"
data-type="number"/>
<xsl:choose>
<xsl:when test="@relink">
<li><a href="{@relink}" target="_blank">
<xsl:value-of select="title"/>
</a></li>
</xsl:when>
<xsl:otherwise>
<li> <a href="{$webrootLang}{substring-after(uri,'/')}">
<xsl:if test="@selected='selected'">
<xsl:attribute
name="class">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="title"/>
</a></li>
<xsl:if test="@selected='selected'">
<xsl:apply-templates
select="$navitreePlugin/collection/items/collection[@selected =
'selected']"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<!--<xsl:if test="position() != last()">|</xsl:if>-->
</xsl:for-each>
</ul>
</xsl:template>
----------
Uncomment all the the stuff between:
<xsl:template name="topnavi"> and </xsl:template> ;)
Would be cool if you find a solution for the validation-errors, I have
not so much time for doing this job ;)
Matthias
>
> cheers, Simon
>
>
> On Oct 3, 2005, at 19:39, Matthias Dieke wrote:
>
>> Hi,
>>
>> are you looking for something like that:
>>
>> http://www.nordicwalking-kiel.de/wissenswertes/ ???
>>
>>
>> If so I can send you the xsl.
>>
>> Matthias
>>
>>>>>
>>>>> I modified the menu a bit and made it an unordered list <ul> in the
>>>>> sidebar. http://strengsong.com Now I'd think it'd be really nice
>>>>> being
>>>>> able to have submenus, which in the XHTML would mean nested
>>>>> unordered
>>>>> lists. Do you have any suggestions on how this could be
>>>>> achieved? (To
>>>>> see some fun examples of what you can do with nested <ul> menus
>>>>> visit:
>>>>> http://www.meyerweb.com/eric/css/edge/menus/ demo.html )
>>>>>
>>>>> I guess one could do this in the same way as Chregu recently
>>>>> explained
>>>>> how to make multilingual site descriptions. http://
>>>>> lists.bitflux.ch/pipermail/bitflux-cms/2005-September/001577.html
>>>>> But that would also make the menu kind of static, or let's say not
>>>>> really easy enough to edit for the average customer.
>>>>>
>>>>>
>>>>
>>>> Nono, the solution is much easier. Look at themes/mobile/
>>>> master.xsl and
>>>> search for
>>>>
>>>> <xsl:template name="topnavi">
>>>>
>>>> It should do exactly what you want, so you can use that code for your
>>>> template.
>>>>
>>>> chregu
>>>>
>>> Hi!
>>> If I understood the mobile example correctly it doesn't actually
>>> produce submenus, or in other words doesn't produce nested
>>> unordered lists.
>>> I'll clarify what I was looking for...
>>> I kind of already did something like the mobile example at http://
>>> strengsong.com by editing the 2-col master.xsl like this (I
>>> basically just inserted <ul> and <li> tags):
>>> <ul id="topnavi">
>>> <xsl:call-template name="topnavi"/>
>>> </ul>
>>> ...
>>> <xsl:template name="topnavi">
>>> <xsl:for-each select="$navitreePlugin/collection/items/
>>> collection[display-order != 0]">
>>> <xsl:sort select="display-order" order="ascending" data-
>>> type="number"/>
>>> <li><xsl:choose>
>>> <xsl:when test="@relink">
>>> <a href="{@relink}">
>>> <xsl:value-of select="title"/>
>>> </a>
>>> </xsl:when>
>>> <xsl:otherwise>
>>> <a href="{$webrootLang}{substring-after (uri,'/')}">
>>> <xsl:if test="@selected='selected'">
>>> <xsl:attribute name="class">selected</
>>> xsl:attribute>
>>> </xsl:if>
>>> <xsl:value-of select="title"/>
>>> </a>
>>> </xsl:otherwise>
>>> </xsl:choose></li>
>>> <!--<xsl:if test="position() != last()">|</xsl:if>-->
>>> </xsl:for-each>
>>> </xsl:template>
>>> But what this does is to produce just an ordinary <ul> menu... what
>>> I was looking for is a possibility to make submenus, that is
>>> nested <ul>:s.
>>> Ie.
>>> <ul>
>>> <li><a href="/">Home<a/></li>
>>> <li><a href="/something">Something</a></li>
>>> <li><a href="/submenu">Submenu</a>
>>> <ul>
>>> <li><a href="/submenu/submenuitem">Submenuitem</a></li>
>>> <li><a href="/submenui/another_submenuitem">Another
>>> submenuitem</a></li>
>>> </ul>
>>> <li>Yet another non sub-menuitem</li>
>>> <li>Another kind of submenu (without a linked title)
>>> <ul>
>>> <li><a href="/anothersubmenuitem/">Anoher submenu item</a></li>
>>> <li><a href="/othersubmenu/item">Or yet another kind of
>>> submenu item</a></li>
>>> </ul>
>>> cheers, Simon-- bitflux-cms mailing list
>>> [email protected]
>>> http://lists.bitflux.ch/cgi-bin/listinfo/bitflux-cms
>>>
>>
>> --
>> bitflux-cms mailing list
>> [email protected]
>> http://lists.bitflux.ch/cgi-bin/listinfo/bitflux-cms
>>
>
--
bitflux-cms mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bitflux-cms