You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Torsten Schlabach <ts...@gmx.net> on 2004/08/30 21:33:09 UTC

Hide Documents in Navigation?

Dear Developer Community,

 

I just wanted to get your view about this:

 

We have a project where we have a need to have documents in our publication
that should not be built into the menu. These documents will be accessed in
other ways, such as direct links in documents that are part of the
navigation or via includes. But of course the editors need to have a way of
creating and accessing these documents.

 

Would it be an option to introduce a new attribute to the sitetree XML
schema such as

 

<xs:element name="node">

    <xs:complexType>

        ...

        <xs:attribute name="link" type="xs:string" use="optional"/>

        <xs:attribute name="invisible" type="xs:string" use="optional"/>

    </xs:complexType>

</xs:element>

 

This could be tested for in menu.xsl like this:

 

<xsl:template match="nav:node">

  <xsl:if test="not(@invisible = 'true')">

  <xsl:choose>

    <xsl:when test="descendant-or-self::nav:node[@current = 'true']">

      <div class="menublock-selected-{count(ancestor-or-self::nav:node)}">

        <xsl:call-template name="item"/>

        <xsl:apply-templates select="nav:node"/>

      </div>

    </xsl:when>

    <xsl:otherwise>

      <div class="menublock-{count(ancestor-or-self::nav:node)}">

        <xsl:call-template name="item"/>

        <xsl:apply-templates select="nav:node"/>

      </div>

    </xsl:otherwise>

  </xsl:choose>

  </xsl:if>

</xsl:template>

 

Are there better ways of achieving the same?

 

Torsten