We have been uploading high resolution Image varieties since 2013, but before that our News images did not have this image variety. I am wanting to use a keyword modifier to check if this variety exists, if it does not just use the regular image url.
So far I am struggling to get anything to work. I have tried:
Neither of these work if the image does not have a variety called 2x.
Note: I have considered using a Batch Trigger to create an image variety for the images that are missing it, but since it is upscaling it looks horrible and pixelated.
I tend to use a conditional keyword on type formats to check if an image variety exists - e.g. checking the value of %asset_thumbnail_v_<variety_name>_width% - to see if it’s the correct size
Not sure, but have you tried:
%image_v_v2_width^eq:$width%
where $width is whatever you’d expect it to be, if you have uniform image dimensions in use?
Are you printing the variety of the thumbnail image asset assigned to the News Item? And if so, how and where are you printing it? In the Paint Layout for the News Item?
If you are printing the image variety of the thumbnail asset on the PL of the News Item, you would need to use the %asset_thumbnail% keyword right?
My experience is that this only works if the thumbnail only has one image variety.
The condition only seems to evaluate if there is an image variety, not what the variety is. (ie it evaluates the part %begin_asset_thumbnail_v but not the _<variety_name>)
No Thumbnail, it evaluates correctly displaying No Thumbnail
A thumbnail with no varieties, it evaluates correctly and displays the Show thumbnail text and the thumbnail
A thumbnail with a different variety, (eg v1 or v2 or both, but no v3) it evaluates incorrectly and displays the text Show variety 3 and no image or img element (as there is no v3).
A thumbnail with a v3 variety (and others) it evaluates correctly and displays the text Show variety 3 and the v3 image.
Has anyone else come to this conclusion or have I missed something?
Does this have something to do with varieties being shadow assets?
The use case was printing <meta property="og:image"> tags for assets using an og variety and if none use the thumbnail or if neither print no og:image meta tag. It worked fine unless the thumbnail already had another variety.