
32
Serena® Collage® 5.1.3
Chapter 3 Design-Time Component Reference
AssetQuery
This component allows you to query for assets that fulfill certain criteria and then
generate HTML that can display the following:
Information about those assets. For example, you can display the asset's filename,
modification date, or metadata fields and values.
A list of links to the files in the query.
If the query returns contribution assets, you can also display the actual content that is
stored in the asset's fields. In this way, you can reuse and re-purpose content that is
stored in a contribution asset. This means that you only need to write key content
once, in a contribution field; to reuse it in other assets, you simply need to define an
AssetQuery component that retrieves and displays the content of the field. To make
changes to the content, simply edit the source contribution asset. The next time you
deploy your website, the revised content will be retrieved wherever the AssetQuery
component is defined. To learn more about content contribution, see the Serena
Collage Project Manager's Guide.
How AssetQuery Works
The opening tag of the AssetQuery component defines the query, which locates the
assets. The body of the tag, contained between the opening and closing component tags,
defines the HTML that will be repeated/generated for each found asset. You can repeat
the same HTML for each found asset, or define different HTML for different sets of assets.
For example, you can display information about the assets in a table, and define unique
formatting for each row or cell in the table.
The AssetQuery component can either search across the entire Collage project, or search
a specific folder, which you can define relative to the location of the deployed asset, or as
an absolute path in the project.
Inside the body of the tag, data field macros are used to access and display specific asset
properties or other information. For example,
$node.filename
will be replaced with the
asset's filename.
For each asset that is found, the body is repeated. For example, If the body contains a
$node.filename
string, and two assets are found, the filename of each asset will be
displayed.
About Previewing AssetQuery Components
When you preview a page that contains an AssetQuery component, and the component
includes a
layout
parameter to format the linked assets, the component will list or
display information about a maximum of five assets, by default. If you want to override
this limitation, in order to list of display more than five assets, you must include the
Previewmax attribute in the component. See "
Previewmax
" on page 42 for details.
About Nesting Multiple AssetQuery Components
To further refine a query, and reduce the need to define redundant queries to return
related assets, you can nest one or more AssetQuery components inside another. This is
useful if, for example, you want to locate and list more than one type of asset, each of
Kommentare zu diesen Handbüchern