Hello,
I have two data record, a quote and a profile and each have their own metadata schema applied and within each schema there is a name field. The quote schema also has a related asset field, with the intention of relating a profile to a quote.
I am trying to create a paint layout that will display a quote and the author and image of the quote will come from the profile data record if the related asset of the quote has been completed otherwise the name and image will come from the quote.
The code I have so far is as follows %begin_asset_metadata_quote.profile% %begin_asset_metadata_quote.profile^as_asset:asset_thumbnail_url% %else_asset_metadata_quote.profile^as_asset:asset_thumbnail_url% %end_asset_metadata_quote.profile^as_asset:asset_thumbnail_url%
%asset_metadata_quote.profile^as_asset:asset_metadata_profile.firstname% %asset_metadata_quote.profile^as_asset:asset_metadata_profile.lastname%, %asset_metadata_quote.profile^as_asset:asset_metadata_profile.jobtitle% %else_asset_metadata_quote.profile% %begin_asset_thumbnail_url%%asset_metadata_quote.body%
%asset_metadata_quote.author%, %asset_metadata_quote.source% %else_asset_thumbnail_url%%asset_metadata_quote.body%
%asset_metadata_quote.author%, %asset_metadata_quote.source% %end_asset_thumbnail_url% %end_asset_metadata_quote.profile%%asset_metadata_quote.body%
This all works correctly and the correct image and name get displayed within the quote, however I get a Squiz warning when no related asset on the quote is supplied.
The warning is - Assetid, '', provided to as_asset keyword modifier is not valid [CORE0321]
I guess its because Squiz translates all the conditionals first before running through them and it cant make "%begin_asset_metadata_quote.profile^as_asset:asset_thumbnail_url%" when no related asset has been set?
Is there a way around this?
Thanks
David