
138
Serena® Collage® 5.1.3
Chapter 5 Advanced Examples
To create a printer-friendly HTML document:
1
Add the following AssetQuery code into the masterpage where you want the "Printer
Version" link to be placed:
2
Add the following code to the layout file (in this example, the file is
PrinterFriendlyHTML.html):
<nexus:component classid="nexus/components/IncludeAsset"
code="$nexusComponents" file="$node.path$node.filename"/>
This code will include the entire body of the asset that is referred by the AssetQuery.
3
Set the
Applied master-page
property for this layout file to
none
.
NOTE
Do not add this AssetQuery in the asset itself or you will get an error when you click
the printer version link.
<nexus:component classid="nexus/components/AssetQuery"
code="$nexusComponents" root="$node.path"
layout="/WebSite/PrinterFriendlyHTML.html"
filter="A.AssetId=$node.assetid">
<a href="$node.detailsurl">Printer Version</a>
</nexus:component>
The
layout
property points
to the alternate
layout file
Kommentare zu diesen Handbüchern