Hi, You need to use granite:renderconditions., please see my response with a working example here: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-manage-different-asset-type-for-different-metadata-in-aem/m-p/672839
You can learn more about granite:rendercondition...