added headings template function

(cherry picked from commit 02457f00b809282d5fa4be19239a33afb3e927c3)