forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Koberg" <...@koberg.com>
Subject Re: Forrest new style
Date Wed, 05 Jun 2002 22:47:39 GMT
Hi guys,

I have been switching around my network - so very sorry if emails bounced!
----- Original Message -----
From: "Konstantin Piroumian" <KPiroumian@protek.com>
> From: "Bert Van Kets" <bert@vankets.com>
> > > What needs to be added/changed:
> > - make the links on the tabs independent of the build target (TMHO we
need
> > some code here :( )
> > - make the top path depending on a site.xml file or some other source
> > - make paging work
>
> Hm... Does anybody have an idea on how to paginate the content? I know how
> to do it when pages are placed in separate files, but how to split an XML
> file into pages and keep it well-formed? It's definitely time to have a
look
> at Stefano's paginating transformer.
>
If you can use a true site map you could do something like:

<xsl:template match="page" mode="snailtrail">

    <xsl:apply-templates select="parent::folder" mode="snailtrail"/>

    <xsl:value-of select="@label"/>

</xsl:template>

<xsl:template match="folder" mode="snailtrail">

    <xsl:variable name="index_id" select="@index_page"/>
    <xsl:variable name="index_page" select="page[@id=$index_id]"/>
    <xsl:variable name="style_fileref">
        <xsl:choose>
            <xsl:when test="$index_page/@xsl_fileref='default' or
not(boolean($index_page/@id))">
                <xsl:value-of select="@xsl_fileref"/>
            </xsl:when>
            <xsl:when test="$index_id='empty'">
                <xsl:text>body_empty-folder.xsl</xsl:text>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$index_page/@xsl_fileref"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>
    <xsl:variable name="_href">
        <xsl:apply-templates select="parent::folder"
mode="snailtrail_path"/>
        <xsl:text>/</xsl:text>
        <xsl:value-of select="translate(@name, ' ', '_')"/>
        <xsl:text>/</xsl:text>
        <xsl:value-of select="translate($index_page/@label, ' ', '_')"/>
        <xsl:value-of select="$index_page/@file_ext"/>
    </xsl:variable>

    <xsl:apply-templates select="parent::folder" mode="snailtrail"/>

    <a href="{$_href}">
        <xsl:value-of select="@label"/>
    </a>

    <xsl:text> : </xsl:text>
</xsl:template>

<xsl:template match="folder" mode="snailtrail_path">
    <xsl:apply-templates select="parent::folder" mode="snailtrail_path"/>
    <xsl:text>/</xsl:text>
     <xsl:value-of select="translate(@name, ' ', '_')"/>
</xsl:template>


Mime
View raw message