I am using a nested search page to list asset names based on a stored search query, which is the value of a metadata field.
This is working OK. But now I want to print the value of a metadata field for each result.
Can't use a search term, as I want the actual value of the found asset's metadata field. Using a keyword replacement for %asset_metadata_<fieldname>% does not work.
I cannot find how to do this. Is it actually possible?
Do you mean that in your search result type format, rather than the %asset_name% - you want the print the %asset_metadata_<fieldname>% value instead - but the metadata value doesn't get output?
Yes, that's exactly what is happening. Seems the keyword replacement is not available on the result type format. Do you know the solution to this, if any?
It should work ok, we use use them on result type formats a lot:
Maybe check:
your fieldname is correct (spelling/case) in the format
is it getting cached - either server or client side
As your assets are getting returned in the results then the following probably wont apply:
if its a recent schema change - might need to regenerate it
also if metadata was added recently check indexing is on - we had an issue where is was off after a recent upgrade and couldnt work out why assets werent get found
I doubt whether caching is a problem, but I'll check. Spelling - yes I've checked that carefully, as it's often where things fall down.
Do you need to explicitly pass in the asset's metadata field to the search asset? I've tried this too, but there doesn't seem to be a way to pass in a variable (that is, it needs a particular term rather than a keyword replacement).
Oh, and the metadata field is just a text field, with a string value.
I know that the metadata fields are available on the assets, because I'm using one of them (not the same one) to filter the results in the search asset.