I am looking for some help to change a manual process is possible. There is a last updated date within a metadata schema and I would like to make this automatic when a page is updated and published. Would this be a matter of editing the paint layout with a keyword modifier?
indent preformatted text by 4 spaces
<!-- Updated details //-->
<meta name="last.updated.date" content="17 March 2023" />
Paint layout:
indent preformatted text by 4 spaces
<div class="row label-row">
<div class="last-updated col-xs-6 col-sm-6 col-md-6 col-lg-6">
<span class="label label-updated" aria-hidden="true"><i class="fa fa-history"></i> Last updated: %asset_metadata_last.updated.date%</span>
</div>
You have a few options here, depending on how it is used:
If this is a metadata date field, there should be an option to use the Last Published Date (last time the asset was made Live) or Last Updated Date as the Default. That will always be dynamic and will change automatically (or rather, will be checked when you use a keyword to access the value).
If it is a metadata text field, you could use a keyword as the Default Value, such as %asset_updated^date_format:j F Y% (or %frontend_asset_updated^date_format:j F Y%).
You could use a trigger on Asset Updated or Asset Status Changed to do a Set Metadata Value action.
Itâs a metadata date field but if this is set to âdefaultâ for last updated date will this not show the default value set in the metadata details? See image.
I think thereâs another setting âShow keyword selectorâ, perhaps down the bottom, that determines if asset attributes like the published date can be used as the default value. You should then see another option beneath the date or from now ones that you have there where you can select Last published date.
HI Iain, yeah you are right. I have now set âshow keyword selectorâ and you can select last updated date as an option for default. Do I need to regenerate this metadata schema as I canât see that option in Matrix 6 at the bottom (Manual says it should be there as before). Thanks again for your help.
From Matrix 6 onwards, you no longer need to regenerate the metadata schema. Instead it will just automatically check the default when needed, so that option has been removed.