add beforerender event
add global template config
add queryAll
update events
fix typo