"Update Styles" with modified template is changing footer text

I use a template for documents, each of which has a document-specific text in the footer. I sometimes modify the template such as adding a new style or modifying an existing one. Then when I load a document that uses this template, I select “Update Styles” when I am told in a dialog that the “template … had been modified”. When I do this, it replaces my existing footer text with whatever text may be in the footer of the template. If the footer of the template has no text, then it deletes my my existing footer text (that is, it replaces my existing footer text with no text).

I have not tested this with headers but expect the same behavior occurs. There was a 2013 posting (Modified template, gives "Update styles" dialog, header disappears) with what seems to be same problem but with headers. There was a related bug report, apparently abandoned as not reproducible. I can reproduce my problem.

I note this text replacing behavior does not occur with paragraph styles in an updated template. (Example: I modified the template by adding a paragraph of text using the Text Body style. When I load a document and Update Styles, it does not replace the existing text of paragraphs using Text Body with the text in the template. When creating a new document, it does, as expected, create the document with that text in a paragraph using Text Body.)

This is very frustrating. Am I doing something wrong, and, if so, what should I be doing? If the answer it to use fields in the footer, I note this would be very laborious and user-unfriendly. I might be able to do this through some combination of Insert/Field/MoreFields/DocInformation entries and possibly Insert/Field/MoreFields/Variables/User Field, but this is rather intimidating for what should be a simple task!

If I am not doing something wrong, is this a bug? An intentional but poor design? Something necessary to how LO is structured? If either of the first two, I am willing to write up a rigorous bug report or feature request.

If the document specific pages have different layout from what you have in the template, you may need a document specific (new) page style. I.e. a page style whih does not exist in the template.

Cf.:

Depending on your strategies for consistent document styling, a page style detached from template may be counter productive. If so, @mikekaganski’s approach - building headers/footers from fields - is the solution you need. That may require more work initially, but in most cases will yield a more robust system for document production.

2 Likes

This is normal, correct, intended behavior.

The headers and footers, including all their content, are part of page style, and thus must be replaced with whatever that page style in the template defines.

If you need document-specific data in headers/footers, create it as fields, possibly referring to user-defined custom properties (under File|Properties).

3 Likes

This works as a solution. Determine the fields you want to use. Simplest is to use the ones in File->Properties->Description. (Note that field names like “Title:” and “Subject:” do not have to be actual titles or subjects but best usage may be to use them as such.)

If you need more fields, File->Properties->Custom Properties allows you to add a number of additional properties. These all have predefined names, so they are not user-defined fields. To add one, click Add Property, find the one you want in the Name drop-down, set the Type drop-down as appropriate such as Text. (If you want user-defined fields, that is more work to get it to work with page templates and custom text in the docs that use the template. As I feared, after hours of trial and error, I can’t quite get it to work as I want and have given up.)

In the template, once you know the fields you want, go into the Header/Footer itself. In the place you want a field, use Insert->Field-> (for the fields in Properties->Description) or Insert->Field->More Fields…->DocInformation->Custom (for the fields in Properties->Description; yes, this UI non-obvious) to find the field name and insert it. Set up all the fields as you want in the Header/Footer.

SAVE THE TEMPLATE!

Now, documents that use the template can have customized Headers/Footers by setting the values of the fields used in the doc’s Header/Footer. If you later change the template such as adding a new paragraph or character style, you will not lose your custom text in the Header/Footer.

ADDITION: If you use File->Properties->Custom Properties in the template, you also have to “activate” them in the documents that uses the template. In the doc, simply go File->Properties->Custom Properties and selected the fields you want. For customized text, you add the document’s custom text as the values to these fields. If you do not do this, nothing is displayed for there fields in the document’s Header/Footer.