Hi, Dorothea, thanks for your response! Here's the code suggested by the
wiki, in full:
<!-- Overriding the main body template -->
<xsl:template match="dri:body">
<div id="ds-body">
<!-- Check for the custom pages -->
<xsl:choose>
<xsl:when
test="/dri:document/dri:meta/dri:pageMeta/dri:metada...@element='request
']...@qualifier='URI']='about'">
<div>
<h1>About us</h1>
<p>Lorem Ipsum dolor si amet</p>
</div>
</xsl:when>
<xsl:when
test="/dri:document/dri:meta/dri:pageMeta/dri:metada...@element='request
']...@qualifier='URI']='faq'">
<xsl:copy-of select="document('faq.xml')" />
</xsl:when>
<!-- Otherwise use default handling of body -->
<xsl:otherwise>
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
I have confirmed that embedding the content within the template.xml (the
'about us' sample above) works, though I'll have to duplicate the logic
elsewhere in the template in order to change the title. The
<xsl:copy-of select="document('faq.xml')" /> code does not work for me,
in any permutation of path to the document, and with multiple copies of
faq.xml sprinkled liberally around the code tree :-)
At your suggestion, I have tried substituting <xsl:apply-templates /> in
place of <xsl:copy-of />, again with multiple permutations of path. This
also does not appear to work.
The more I think about it, this whole business of shoehorning static
code at this level seems wrong. I am going to see if I can spelunk my
way through figuring out the cocoon-based method. Ideally, what's
required here is an aspect which would accommodate displaying any number
of static DRI files.
I have a promising lead here:
http://www.mail-archive.com/[email protected]/msg04894.h
tml
as well as a number of posts on your wonderful blog. I'll let the list
know if I get anywhere.
I'll also renew my query: if anyone on the list has done something like
this in the past, please contact me on or off list, I'd love to pick
your brain.
--Hardy
> -----Original Message-----
> From: Dorothea Salo [mailto:[email protected]]
> Sent: Wednesday, February 18, 2009 10:13 AM
> To: Dspace Tech
> Cc: Van Ly; Diggory Mark
> Subject: Re: [Dspace-tech] adding static pages to a DSpace
> site using xmlui
>
> On Thu, Feb 12, 2009 at 10:25 PM, Pottinger, Hardy J.
> <[email protected]> wrote:
> > Hi, thanks Mark and Van, mvn and ant move these new files just fine
> > (they are where you suggested, Mark). My issue is that the
> modification
> > to template.xml suggested by the wiki...
> >
> >
> http://wiki.dspace.org/index.php/Manakin_theme_tutorial#Adding
> _static_pa
> > ges
> >
> > ...does not appear to work. I did try to feed "xsl:copy-of
> select" the
> > full path (/themes/[your-theme]/pages/add.xml), as I
> thought maybe that
> > was what you were suggesting, but I'm still seeing a Page not found
> > error in the title of the page, and a blank body (i.e. all
> the other>
>
> Okay, your problem is that you can't <xsl:copy-of> an external
> document. You have to do a document() call. What will probably work is
> some variation on
>
> <xsl:apply-templates select="document(http://path-to-your-doc.html)"/>
>
> I'm not sure off the top of my head whether you should be using the
> http: or cocoon: scheme, or whether the path should be absolute or
> relative (though absolute *should* work), but play around a bit and
> see if this doesn't fix it.
>
> Dorothea
>
> --
> Dorothea Salo [email protected]
> Digital Repository Librarian AIM: mindsatuw
> University of Wisconsin
> Rm 218, Memorial Library
> (608) 262-5493
>
> --------------------------------------------------------------
> ----------------
> Open Source Business Conference (OSBC), March 24-25, 2009,
> San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing
> the Enterprise
> -Strategies to boost innovation and cut costs with open
> source participation
> -Receive a $600 discount off the registration fee with the
> source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> DSpace-tech mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech