For Dexterity content types I was able to achieve that by registering an adapter to zope.publisher.interfaces.browser.IBrowserRequest, overriding the default adapter plone.dexterity.browser.traversal.DexterityPublishTraverse.
from plone.dexterity.browser.traversal import DexterityPublishTraverse
from zope.component import adapter
from zope.publisher.interfaces.browser import IBrowserRequest
def publishTraverse(self, request, name):
return DexterityPublishTraverse.publishTraverse(self, request, name)
# Do your thing here.