We have dates on our sites which are used across multiple pages. Some are used in a table, some within a sentence etc.
Ie. On 30 June, all applications…etc.
Is there a way of setting up a single source so we can update in one place? I had a look at snippets, but that seems like its for sections of content.
Metadata seems like the right way (with using keyword replacements where the dates are) but I’m hitting a blank as how to do it. IE. What asset type would I use as the source to update all fields at once.
We have used Data Record assets to store common values in metadata, and then referred to them inline, example:
A processing fee of %globals_asset_metadata_Fee:12345% applies.
In this case we used one metadata field across multiple assets (ie using the assetid to specify the particular fee), but you could also use one asset with multiple, well named metadata fields.
We store the Data Record assets outside of the Site so that they don’t get URLs, adding the folder where they are stored into the ‘assetFinderLocations’ Edit+ configuration, so our editors can get to them easily.
This works fine, but in either case the keywords can get pretty long, which isn’t great for inline editing. If you’re after something succinct and don’t have many of them, you could use a replace modifier on the contents keyword in the paint layout. For example (using the token **disclaimer**):
Directly in paint layout (not best idea):
%asset_contents^replace:\*\*disclaimer\*\*:Disclaimer text here%
I tested this with handlebars like syntax {{disclaimer}} and it works, but as curly brackets are used for matrix nested keywords, probably best to use a different syntax.
Data records can be viewed like a page, if you don’t design for that and they just inherit a standard paint layout/ design, they can effectively be viewed as a blank page on the frontend. For the most part this isn’t a problem if they are TYPE2’d and not discoverable, but, we’ve had instances where things have become discoverable for one reason or another, this just removes that possibility.