
AssetQuery
Components User's Guide
47
Asset metadata
. To display the value of a metadata field, you must use the following
syntax:
$node.meta
(
'metadata_name'
)
For example,
$node.meta('Reviewer')
URL fields
. You can use the following syntax to generate the URL to the asset in the
current query record:
$node.url
You can use this value to generate a link to the asset, for example:
<a href="$node.url">
You can also automatically generate URLs to pages which are generated using
contribution layout files. This includes the HTML versions of contribution assets, or
any other type of web page. For example, you can merge all of the content from an
HTML file with different layout files. This allows you to automatically create alternate
versions of HTML files, each with unique formatting derived from different layout files.
The AssetQuery component can then locate and link to these generated files.
Use the following syntax to generate this URL:
$node.detailsurl
To link to the HTML versions of contribution assets, the component must include a
layout
property, which determines which contribution layout file will be used to
generate the HTML. By including multiple AssetQuery components, each of which
defines unique layout files to generate the HTML version of contribution assets, you
can create links to alternate versions of the same page. For example, you can use one
layout file to generate and link to an online version of a page, and another to link to a
print version of a page.
See page 52 for details.
Contribution field
. If the asset in the current query record is a contribution asset,
you can use the following syntax to display the content from a contribution field in the
asset:
$node.contribution
("
field_name
")
For example, if the field name is Title, you can use this syntax to display the content
from the field:
$node.contribution
(
"Title"
)
$node.name
Displays the asset name
$node.Size
Displays the asset's filesize
Field Description
TIP
The
$node.url
macro generates a relative URL. You can also generate an absolute
URL to the asset by instead using the
$node.absurl
.
Kommentare zu diesen Handbüchern