On Tue, Dec 11, 2012 at 3:54 AM, Nemiz, Elvi <esne...@seafdec.org.ph> wrote:
> I have added a template in my theme.xsl to override the default rendering
of
> the summaryList pattern which can be found on the community-list and front
> page. I want to enclose or wrap this hierarchy list with div tags. Please
> advise what part and what file do I need to edit. Please see attachment of
> my theme's xsl. I want to put my starting div tag just after the text that
> says "Select a community to browse its collections."
You can't easily do it using the template you used, because it's recursive.
You couldn't do an xsl:if on the top and the bottom with the opening and
closing tag, because that would violate the xml tag closing requirement.
You could do this, but of course that looks ugly:
<xsl:template name="subtemplate">
<xsl:apply-templates select="dri:head"/>
<!-- Here we decide whether we have a hierarchical list or a
flat one -->
<xsl:choose>
<!-- Adds treeview functionality to communities and
collections page -->
<xsl:when
test="descendant-or-self::dri:referenceSet/@n='community-browser' or
ancestor::dri:referenceSet/@n='community-browser'">
<ul>
<xsl:apply-templates
select="*[not(name()='head')]" mode="summaryList" />
</ul>
</xsl:when>
<xsl:when
test="descendant-or-self::dri:referenceSet/@rend='hierarchy' or
ancestor::dri:referenceSet/@rend='hierarchy'">
<ul>
<xsl:apply-templates
select="*[not(name()='head')]" mode="summaryList"/>
</ul>
</xsl:when>
<xsl:otherwise>
<ul class="ds-artifact-list">
<xsl:apply-templates
select="*[not(name()='head')]" mode="summaryList"/>
</ul>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="dri:referenceSet[@type = 'summaryList']" priority="2">
<xsl:choose>
<xsl:when test="@n='community-browser'">
<div>
<xsl:call-template name="subtemplate" />
</div>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="subtemplate" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
So instead, I'd choose to do it simply by defining a more specific template
with a higher priority:
<xsl:template match="dri:referenceSet[@type = 'summaryList' and
@n='community-browser']" priority="3">
<div>
<xsl:apply-templates />
</div>
</xsl:template>
Also, some unsolicited advice. Don't do all the imports of the copied
template. This way you wouldn't get any updates to the Mirage theme during
the next upgrade. Instead, to this:
<xsl:import href="../Mirage/Mirage.xsl"/>
Then delete mytheme/lib/xsl. You still have to
have mytheme/images, mytheme/lib/css and mytheme/lib/js copied in,
unfortunately.
Regards,
~~helix84
Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette