You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Erik Stunkat <er...@stunkat.de> on 2006/07/27 09:59:24 UTC

DirectoryGenerator and linking to content

Hello,

I have something like:

xdocs/books/moderntrends/
        /book1/
                - pdf file
                - pdf file
        /book2/
                - pdf file
                - pdf file

etc

what I want:
display the pdf files when I go to 
http://blablabla../books/moderntrends/book1

and link to those files

my sitemap:

<map:pipeline>
<map:match pattern="books/moderntrends/**" type="wildcard">
<map:generate type="directory" 
src="{project:content.xdocs}/books/moderntrends/{1}/">
<map:parameter name="depth" value="8"/>
<map:parameter name="sort" value="directory"/>
<map:parameter name="include" value="^({1})"/>
</map:generate>
<map:transform type="xslt" src="{project:resources.stylesheets}dir2.xsl"/>
<map:serialize type="html"/>
</map:match>
 </map:pipeline>

my stylesheet:

<xsl:template match="dir:directory|dir:file">
        <li>
        <xsl:value-of select="@name"/>
                <xsl:if test="name(.)='dir:directory'">
              <!-- creating subdirectories -->
                        <ul><xsl:apply-templates/></ul>
           
            </xsl:if>
            <xsl:for-each select="@name">
             <a href="{generate-id(.)}">
            <xsl:value-of select="."/>
            </a>
            </xsl:for-each>
           </li>
</xsl:template>

<xsl:template match="/dir:directory">
        <ul>
                <xsl:value-of select="@name"/>
                <!-- creating subdirectories -->
                <xsl:apply-templates/>
              </ul>
</xsl:template>




this works for http://blablabla../books/moderntrends/

not for http://blablabla../books/moderntrends/book1


also I get something like:

<li>
487-Infection_of_Mouse.pdf
<a href="N10D95">487-Infection_of_Mouse.pdf</a>
</li>
?
    <li>
491-Cocultivation_as_a.pdf
<a href="N10D9A">491-Cocultivation_as_a.pdf</a>
</li>

the href shows something wrong.

any ideas?

erik stunkat

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: DirectoryGenerator and linking to content

Posted by Mark Lundquist <ml...@wrinkledog.com>.
Hi Erik,

On Jul 27, 2006, at 12:59 AM, Erik Stunkat wrote:

> this works for http://blablabla../books/moderntrends/
>
> not for http://blablabla../books/moderntrends/book1

OK, well what does it do instead of working? :-)

> also I get something like:
>
> <li>
> 487-Infection_of_Mouse.pdf
> <a href="N10D95">487-Infection_of_Mouse.pdf</a>
> </li>
> ?
>    <li>
> 491-Cocultivation_as_a.pdf
> <a href="N10D9A">491-Cocultivation_as_a.pdf</a>
> </li>
>
> the href shows something wrong.

Sounds like the output of DirectoryGenerator is different than what you 
expect... have you tried setting up a pipeline (or view) that just lets 
you look directly at that XML?

cheers,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org