Does Confluence allow setting variables in templates?
Confluence at the moment allows setting variables in templates but does not have a functionality to “require” fields. There may be possible solutions such as using Scaffolding add-on or using JIRA depending on your needs.
The Scaffolding add-on is a powerful tool for Atlassian Confluence that allows the creation of permanent templates and editable forms.
Also, you can try the approach of writing a custom user macro. Writing user macros can be done in Confluence UI and does not require any developer tools. But may require some level of scripting knowledge.
Refer to Atlassian Answers site for relevant community discussion.