Form template

I know this is possible for the grid and I wonder if I can do it for the Forum as well. I’m wondering if this is possible - to place my own variable in the form template and assign the value to it when the form is opened. I’m talking here about the TEMPLATE (html) file not the variable in Form properties. If so - how would I do this ? any examples ?

thank you

actually I would like to extend this question and find out how to do the same for the other apps i.e. MENU