I would also recommend to use renderconditions, but instead of rolling your own rendercondition in the first place, you can use the ootb renderconditions, see https://developer.adobe.com/experience-manager/reference-materials/6-5/granite-ui/api/jcr_root/libs/granite/ui/docs/server/rendercondition.ht...