Update template with variables reset the values on documents based on that template

Hi,
I created a writer template with a text variable for the topic. (On the header)
The default value for this variable is “Title”
After saving the template, I created a Writer document based on that template.
In the document, I set the title to the actual title text.
(By entering the actual title string on the popup edit box)

After some time, I decide to change something on the template. (Unrelated to the title variable!)
The next time I opened the document that used that template, LO asked me if I wanted to update the style, which I approved.
Now the title reverts to the default value! (“Title”)
Can the values of the variables be kept when the template changes?
Right now, after changing the template, I need to re-write all the variables on all the files that use that template.

This is not about variables, this is about styles, and specifically about “what constitutes a page style”.

So: a page style consists of page size, margins, borders, etc. - everything you find in the Page Style dialog (as you would naturally expect) - and the headers and footers: both their geometry that you define in the said dialog, and their full contents.

Every time you update the page style, you replace every bit of that style with whatever is defined in the template, including headers and footers content. This is normal and expected. But that also means that any variable content in headers and footers must either be defined as fields, and those field values must be defined elsewhere (not in headers/footers), or you must rename the styles, so they become independent of whatever comes from updated templates (and then you loose the ability to get updates into those styles).

If you follow the former route, you may e.g. use cross-references to headings; or you may define some custom document properties, and use DocInformation fields to refer to them; or you define variables in the text body, and show the variables in the headers.

1 Like

Thanks! I will dive into it to understand the best solution between those options