I'm working on an implementation for a social media gallery where users can upvote/like content. I'm storing the info about what content they've liked as a list of asset ids in a metadata field for the user asset.
In the asset listing for the gallery, I'd like to output (for the moment) just a simple "yes" or "no" string for each image if its asset number is listed in the user metadata field for images they've liked. This is my keyword:
%globals_user_metadata_gallery_likes^replace_keywords:contains:{asset_assetid}:yes:no%
The problem I'm having is that my {asset_assetid} keyword is being treated globally, rather than in the context of the asset listing. It's checking to see if the gallery_likes metadata contains the asset id of the current page (the gallery) rather than the current asset being listed (the image).
Is there a way round this? I can always javascript my way out of it, but I'd love to do this server-side. Is there a global variable I can use to get the currently listed asset ID?