Hi all, I've been trying to print images in layouts only if they exist and contain a certain a variety - otherwise they're to be replaced by a default image. There's many ways to do this, but the most efficient way for me has been to use:
%asset_thumbnail_v_XXX_url^empty:./?a=XXX%
This only returned a seemingly empty string when the variety didn't exist, which after checking with charcount, I found was 21 characters long. I urlencoded the result and found out that it literally returned the string: "%image_v_XXX_url%" - which won't actually render on the front end because it's empty, however this means that whenever you use image_variety_XXX_url, it will never be able to be modified with ^empty even though it's technically empty.
I've also tried ^as_asset modifier without success: %asset_thumbnail_assetid^as_asset:image_v_XXX_url^empty:./?a=XXX%
This is okay, because I've now swapped out ^empty to ^replace and can now get my default image in there, but can I ask, is this likely to be a bug? I'd like to know, as my fix will stop working if it is a bug and is fixed.
Here's what I've had to implement for now:
%asset_thumbnail_v_XXX_url^replace:.*image_v_XXX_url.*:./?a=XXX%