
MetaTag
Components User's Guide
83
MetaTag Example 1
The following example retrieves the value of a metadata field called
product
, and names
it "Product Name":
<nexus:component classid="nexus/components/MetaTag"
code="$nexusComponents">
<meta NAME="Product Name" content="$node.meta('product')">
</nexus:component>
If the value of the
product
metadata field for the asset is
Collage
, Collage will generate
the following tag when the asset is deployed:
<meta NAME="Product Name" content="Collage">
MetaTag Example 2
The following example retrieves the value of a metadata field called release_date, names
it "Release Date," and applies a date format to it:
<nexus:component classid="nexus/components/MetaTag"
code="$nexusComponents">
<meta NAME="Release Date"
content="$node.meta('release_date',yyyy.MM.dd)">
code
Always set to the path in
Collage to the
nexusComponents.jar file,
such as
"/System/
Components/
nexusComponents.jar"
The archive where the component class file is stored.
By default, this is stored in:
/
root
/System/
Components/nexusComponents.jar
. You can also
set this property to:
code="$nexusComponents"
which will resolve to the correct path.
useoriginalassetid true
or
false
If you will use the Include Asset component on other
pages in your project to reuse your MetaTag
component on multiple pages,
you must include
the
useoriginalassetid
property and set it to
true
. This ensures that each instance of the MetaTag
component which is generated by the Include Asset
component displays the metadata for the correct
asset. Otherwise, the MetaTag component may
display metadata for the asset that contains the
Include Asset component, not the original asset
which contains the original MetaTag component.
For example, if the MetaTag component is defined on
a page called common.html, and you use the Include
Asset component to display the contents of
common.html on all pages, you must include:
useoriginalassetid="true"
to make sure that the Include Asset components
display the metadata for common.html, and not the
pages which contain the Include Asset component.
Property Value Description
Commenti su questo manuale