Use cms.beforeDisplay event