Matrix Version:5.4.3.1
When a content editor adds a link to a document within some content on a page, we’d like it to display a linked name to the document, the file type (e.g. PDF) and the file size (e.g. 2mb).
We have created a paint layout that does this:
<div class="doc-row">
<div class="doc-title"><a href="%asset_url%">%asset_attribute_title%</a></div>
<div class="doc-info">%asset_type^maxwords:1% %asset_file_size_readable%</div>
</div>
Then we use global keywords in the content to apply this paint layout to the document we’re linking to:
%globals_asset_contents_paint_layout_id_345146:291731%
and with the CSS applied it looks like this:
All well and good, but we wondered if there’s either a) a different way to do this or b) a way of adding the global keyword to the list of matrix keywords available in the WYSIWYG editor so that content editors can simply select it, then add the asset number of the file they want to reference.