> From: Dirk Hartmann [mailto:[EMAIL PROTECTED] > I can't find any tutorial where to put > a .xsl file which fills my div... Is "navigation" in my current > publication the right place?
Hi Dirk I have been experimenting with this. I am copying to you an earlier email to this list that you may find relevant. It includes a HowTo that I wrote, plus also a different idea from SolProvider that I haven't had time to try yet. SolProvider: BTW, Thanks heaps for this. Not sure I quite understood your problem properly, Dirk, but I hope this might help you get on the right track. Joe Grist ------------------------------------------------------------------- On 10/24/05, Joe Grist <[EMAIL PROTECTED]> wrote: > I have added a new bit to the wiki. Just letting people know incase > it is useful. It's under > http://wiki.apache.org/lenya/HowToFullyCustomMenus > again. > > Its on how to create a new kind of menu for your site pages. It lists > all the pages immediately below the current page in the heirarchy > under the heading "In This Section". If there are no pages immediately > below the current page, it disappears. This is an extremely useful bit of code I find. Here is a much simpler solution. There are no changes to the XMAP or menu.xsl. It only requires changing page2xhtml.xsl, and most of the code could be put in a separate file for easier maintenance. Put this line in your page2xhtml.xsl: <xsl:apply-templates select="xhtml:[EMAIL PROTECTED] = 'menu']" mode="section"/> where you want the section menu, and these matches near the bottom: <xsl:if test="xhtml:[EMAIL PROTECTED]'menublock-selected-1']/xhtml:[EMAIL PROTECTED]'menublo ck-selected-2']|xhtml:[EMAIL PROTECTED]'menublock-selected-1']/xhtml:[EMAIL PROTECTED] s='menublock-2']"> <xsl:copy> <xsl:apply-templates mode="section"/> </xsl:copy> </xsl:if> </xsl:template> <xsl:template match="xhtml:[EMAIL PROTECTED]'menublock-selected-1']" mode="section"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="section"/> </xsl:copy> </xsl:template> <xsl:template match="xhtml:[EMAIL PROTECTED]'menublock-1']" mode="section"/> <xsl:template match="xhtml:[EMAIL PROTECTED]'menuitem-selected-1']|xhtml:[EMAIL PROTECTED]'menublo ck-selected-1']/xhtml:[EMAIL PROTECTED]'menuitem-1']" mode="section"> <div class="menuitem-selected-1">In This Section</div> </xsl:template> <xsl:template match="@*|node()" mode="section" priority="-1"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="section"/> </xsl:copy> </xsl:template> The first match copies the menu div and passes the mode lower. - Remove the xsl:if to always show the section menu even when there are no lower levels. The second match copies the menublock-selected-1 div and passes the mode lower. The third match removes the menublock-1s. The fourth match changes the menuitem-1 to "In This Section". - Make it an empty match if you do not want any title. You could add static text (like "In This Section") directly in your HTML, but it would not disappear if there were no lower documents. - Remove this match if you want the title of the section to appear and be a link when on a lower document. - Use <div class="menuitem-selected-1"><xsl:value-of select="."/></div> if you want the title to appear, but never as a link. The fifth match copies everything else. --- Some more work could change the class names to use different CSS than the regular menu so both can appear on the same page. If you want to use this code in several page2xhtml.xsl files, put this code into common-section.xsl and use: <xsl:import href="common-section.xsl"/> and the placement line in your page2xhtml.xsl files. solprovider --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
