Relation

Creates a relationship between two documents. Examples of such relationships include: stylesheet, alternate stylesheet, shortcut icon, copyright, bookmark, chapter, glossary, help, home, next, prev, e.t.c.

Note that a Shell component is required when using the Relation element. The Shell component is responsible for gathering all Relation components found in a page, and rendering them inside the <head> tag.

See also: Style , Shell

Parameters

Name Type Direction Required Default Description
href String or IAsset in yes The target URL of the related resource.
rel String in no literal:stylesheet Defines the relationship between the current document and the targeted document.
type String in no literal:text/css Specifies the MIME type of the target URL.
rev String in no Defines the relationship between the targeted document and the current document, i.e. the reverse relationship.
title String in no The title of the relation.
media String in no Specifies on which device the document will be displayed.

Body: removed

Informal parameters: forbidden

Reserved parameters: none

Examples

This example demonstrates how a component (in this case Article) can declare relationships to external documents. In this case, all declarations (a stylesheet, a shortcut icon and a copyright document) are rendered inside the <head> tag of the containing page.

Home.html

<html jwcid="@Shell" title="Relation Example">
   <body jwcid="@Body">
      <span jwcid="@Article"/>
  </body>
</html>

Article.html

<link jwcid="@Relation" href="main.css" media="all"/>                
<link jwcid="@Relation" rel="shortcut icon" href="favicon.ico" type="image/gif"/>
<link jwcid="@Relation" rel="copyright" href="http://www.gnu.org/copyleft/fdl.html"/>  
Article details ...

Article.jwc

<component-specification allow-body="yes" allow-informal-parameters="no">
</component-specification>