Dublin Core in Vertical Site

Sometimes you need to expand the concept of metadata, and the Dublin Core standard is an easy match for Vertical Site.

Once again, I use the new website at Helsebiblioteket for my example.

The only thing you need to do is to change your datasource in page template level. Meta-tags is always presented in the page template XSL.

I have a standard global set of DC.tags displayed, and a default set for the menuitems. You will always be on a menuitem of some sort, but I override some of the DC.tag whenever a content is displayed.

<xsl:param name="schema.DC" select="'http://purl.org/dc/elements/1.1/'"/>
<xsl:param name="DC.format" select="'text/html'"/>
<xsl:param name="DC.contributor" select="'Helsebiblioteket - oppdatert fagkunnskap for norsk helsepersonell'"/>
<xsl:param name="DC.publisher" select="'Helsebiblioteket'"/>

A little further down in my page XSL I have this:

<xsl:template name="meta">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<link rel="schema.DC" href="{$schema.DC}" />
<meta name="DC.language" content="{$language}" />
<meta name="DC.format" content="{$DC.format}" />
<meta name="DC.contributor" content="{$DC.contributor}" />
<meta name="DC.publisher" content="{$DC.publisher}" />
<xsl:choose>
<xsl:when test="$content/@key and $content[@contenttypekey = 1009]">
<meta name="DC.title" content="{$content/title}" />
<meta name="DC.creator">
<xsl:attribute name="content">
<xsl:choose>
<xsl:when test="/verticaldata/contents/relatedcontents/content[@key = $content/contentdata/authors/content/@key]">
<xsl:value-of select="/verticaldata/contents/relatedcontents/content[@key = $content/contentdata/authors/content[1]/@key]/title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$content/owner"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</meta>
<meta name="DC.date">
<xsl:attribute name="content">
<xsl:call-template name="formatDate">
<xsl:with-param name="date" select="$content/@timestamp"/>
<xsl:with-param name="format" select="'sitemapXML'"/>
</xsl:call-template>
</xsl:attribute>
</meta>
<xsl:if test="/verticaldata/contents/relatedcontents/content[@key = $content/contentdata/subject/content/@key]">
<meta name="DC.subject">
<xsl:attribute name="content">
<xsl:value-of select="/verticaldata/contents/relatedcontents/content[@key = $content/contentdata/subject/content[1]/@key]/title"/>
</xsl:attribute>
</meta>
</xsl:if>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
....
</xsl:template>

And that's really it. The Dublin Core spec is a lot bigger than this but this shows how easy it is to get started.

Comments

If you want to comment on this article you need to be logged in.

Published in 2011

2010

2009

2008

2007