[ticket/11747] Use _prepend and _append for template events

PHPBB3-11747