add onParseTemplate hook and fix redirection for configurable default mode
fix disabling global buttons
register onParseTemplate