Metadata value not showing on the site


#1

Matrix Version: v5.3.4.0

We need to add metadata description on the pages but would like to grab the value from another existing metadata fields (ie. DCTERMS.description).

I added the following to design parse file:

<meta name="description" content="%asset_metadata_DCTERMS.description%" />

and that serves the purpose quite well. However, I got an empty value when I am on the homepage. DCTERMS.description shows correct value but description is empty.

Standard page asset that is the default page for the site is called “Home”. When I got to http://example.com/home the description metadata is fine. But when I am on http://example.com (without /home) the description metadata is empty.

I am not sure how to resolve it. Please help.


#2

Never mind, apparently it will work if I use the following instead:

<meta name="description" content="<MySource_PRINT var="asset_metadata_DCTERMS.description" />" />

Not sure what’s the difference but it works.


(Peter McLeod) #3

Hi

have you tried using the global scope for the keyword (or possibly the ‘frontend’ option in newer versions):

<meta name="description" content="%globals_asset_metadata_DCTERMS.description%" />

Thanks
Peter


(Bart Banda) #4

That’d be due to the value probably getting sourced from the Site asset and not the index page asset.

You are probably also best off putting those keywords in a Standard Page and nesting them into the design instead. Keywords in Parse Files don’t get evaluated in /_edit mode, also, the less editing you need to do directly in the parse file the better.


#5

Hi Peter, yes I tried that but it didn’t work


#6

Thanks @Bart I will have a play with that.