Not sure if this is correct place - looked for whether this had been discussed anywhere else.
I'm trying to use double quotes in an asset listing. Assets listed have a related asset metadata field which points to an image asset. In the listing the image is listed like a thumbnail (but not a thumbnail). Having image is optional, so some assets in the listing should show an image and some should not.
I'm currently using this:
<img src="%asset_metadata_XXX.Image_asset_url%" alt="" />
and use CSS classes, etc to hide the image completely when it is empty. This looks fine but it still leaves a useless, empty img tag in the source code. My web crawler reports a broken link (treats empties as a fail), which of itself is not a major issue either, I think I'm just a perfectionist.
What I'd like to use is something like this:
%asset_metadata_XXX.Image^notempty:<img src="%
%asset_metadata_XXX.Image_asset_url%
%asset_metadata_XXX.Image^notempty:" alt="" />%
Line breaks are just to show the idea. So if the metadata field is empty no HTML ever gets written. However, whenever I put a double quote in the keywords no longer work (in fact the entire design fails). I've tried escaping using \" but then the keyword is completely ignored. I've even tried using " (which I have used before in time formats) which renders fine in the browser for human reading but for generating raw HTML code. Using single quotes instead of double quotes works fine but then my HTML validation fails.
Another way I've though to do it is nest another listing within the type format for the asset returned and use the metadata field related asset as the root replacement. I think this would work, but it seems a lot of effort for something that should be relatively easy, and I'm not sure what performance impact that would have (probably not worth considering once the page has been placed in cache).
So, question is, can double-quotes be used in keyword modifiers? If so, how?
I'm on Matrix v4.4.3.
Cheers