Frontend Asset Keywords
Last Updated: 04 Sep 2017
This entire manual refers to a feature that was added in version 5.3.5.0
Frontend Asset Keywords can be used to always access the very frontend asset of the requested URL. For example, if I visit https://www.example.com/page, %frontend_asset_assetid%
would give me the Asset ID that corresponds to the Asset at that URL.
Keyword Replacement | Information Shown |
---|---|
%frontend_asset_<common_keyword>% | Any Common Keyword of the frontend asset. For example %frontend_asset_assetid% or %frontend_asset_name% . |
%frontend_asset_attribute_<attribute>% | Any attribute of the current frontend asset. For example, %frontend_asset_attribute_name% shows the Asset Name of the current frontend asset the user is currently viewing. |
%frontend_asset_metadata_<fieldname>% | Any metadata value of the current frontend asset. For example, if you have a Description metadata field on your asset, %frontend_asset_metadata_Description% will show the value of this field. |
This keyword can also be used in keyword conditions within type formats for listing based assets like the Asset Listing and Search Page. This is useful for when you want to compare each listed asset against the current frontend asset that is being viewed by the user.
For example, the following keyword format within a Type Format content container will print a class of "active" if the listed asset has the same ID as the current frontend asset being viewed:
<li %asset_assetid^eq:{frontend_asset_assetid}:class="active":%> %asset_name_linked% </li>
Another example is if you want to use it within a conditional keyword block within a Type Format:
%begin_asset_assetid^eq:{frontend_asset_assetid}% The current listed asset has the same name as the frontend asset. %end_asset%