
Creating Printer-Friendly HTML Documents
Components User's Guide
137
11
Edit the Press Release_layout.html file and add the following code:
12
Save the file and check it in.
In this example, the Select component checks the PrintVersion metadata on the asset. If
it is set to Yes ("1"), the AssetQuery runs, pointing at the alternate layout file specified by
the AssetQuery's
layout
property.
If you look at the properties of this alternate layout file, you can see that
Applied
master-page
has been set to
none
, which accomplishes the desired effect for the
printer-friendly version of this asset.
If there are certain files that do not need an alternate print version, simply change the
metadata value to No ("0") and the link will not get created.
You can use this example on a more global scale by inserting this code on a master page
in order to apply to more files on the website.
Creating Printer-Friendly HTML Documents
This example shows you how to create a printer-friendly version of an HTML document.
This procedure is similar to the procedure for creating printer-friendly contribution
documents, in that you point to an alternate layout file without an applied masterpage.
This procedure uses the following components:
AssetQuery
IncludeAsset
<nexus:component classid="nexus/components/Select"
code="$nexusComponents"
select="$node.metadata('PrintVersion')">
<nexus:select "1">
<nexus:component classid="nexus/components/AssetQuery"
code="$nexusComponents"code="$nexusComponents"
layout="/WebSite/PressRoom/print_versions/
print_release.html"
filter="A.AssetId=$node.assetid">
<a href="$node.detailsurl" target="_blank">Print
version</a>
</nexus:component>
</nexus:select>
</nexus:component>
The
select
property
checks the PrintVersion
metadata
If metadata value
is Yes ("1"), the
AssetQuery runs
The AssetQuery
points to an
alternate layout file
Kommentare zu diesen Handbüchern