
24
Serena® Collage® 5.1.3
Chapter 3 Design-Time Component Reference
For example, with the Navigation Bar component, you could use macros in the following
way:
1
Add the Navigation Bar component to a master page
2
Define the Navigation Bar component so that it automatically generates links to all
assets in the current deploy folder
3
Use a macro to define the text for each navigation button as the name of the asset
that it links to
4
Apply the master page to multiple pages, in different deploy folders
When you deploy the pages, Collage will correctly label each button in each instance of
the Navigation Bar. In this way, you can automatically generate potentially thousands of
button names without having to manually enter any of the text.
For more information on the Navigation Bar component, see "Navigation Bar" on page 84.
What Types of Assets Can You Define Macros For?
You can use data field macros to insert information about any of the following types of
assets:
Any file asset
, such as HTML or JSP files. To insert information about a file asset,
begin each macro with
$node
, for example:
$node.filename
Inserts the name of the asset file.
Deploy folders
, including contribution folders. Folder macros return information
about the folder to which the current asset belongs. For example, you can use a folder
macro to return the name of the folder to which the asset that contains the
component belongs.
To insert information about a deploy folder, begin a macro with
$parent
, for example:
$parent.assettype
Inserts the asset type of the folder, such as Deploy Folder.
Deploy maps
. Deploy map macros return information about the deploy map which
was used to deploy an asset. For example, if you use a deploy map called Staging
Publish to deploy assets, you can use deploy map data macros to display information
about the Staging Publish deploy map.
To insert information about a deploy map, begin a macro with
$publishmap
, for
example:
$publishmap.creator
Inserts the ID of the user who created the deploy map.
Contribution documents
. In addition to standard file and asset information, you can
also insert the content from specific contribution fields from contribution document.
To insert the content from a contribution field, define a macro as follows:
$node.contribution(
"field_name"
)
Where
field_name
is the name of the contribution field.
Kommentare zu diesen Handbüchern