Overriding a renderer


I am trying to make my OmekaS instance GDPR compliant, and i think there’s no solution other than modifying the renderers of medias to include the modifications i need.

Reading the show.phtml from my theme, i see that a media is rendered like this media.render() with no options for me to select which renderer to use

Can override omeka’s default youtube renderer by creating a new one named the same, or should i rather tweak my theme and do something like if media.type == 'youtube' media.renderGDPR() ?


You should be able to override it by registering a renderer with the same name, yes. This would probably need to be done in a module.

1 Like

It does works indeed! Thanks. I’ll update the thread when i’m done

Okay, it works! I have a re-written Youtube renderer that plays nicely with tarteaucitron (the cookie management solution i used) Once my code is cleaned i’ll put a github link if someone is interested i guess

1 Like