Ask Your Question
0

How do I assign a template to a document?

asked 2016-05-04 01:24:39 +0100

Arskin_Fertrubble gravatar image

updated 2016-05-04 01:33:00 +0100

I know that Libreoffice has a template directory and that it differentiates between template documents and working documents.

I also see there is a menu option Files > Templates > Assign Template to current document

However, the menu item has no effect. It prompts me to select the template document, but the template is not applied.

So, how do I assign a template to my document?

Thanks

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted
0

answered 2020-02-25 11:23:05 +0100

ajlittoz gravatar image

updated 2020-10-16 16:57:24 +0100

Changing or assigning a template is very easy with DocumentTemplateChanger extension.

(link edited on 2020-10-16 after a URL changer on the extensions site)

Load and install the extension from the link above. This will patch menu File>Templates adding two new items Change template (current document) and Change template (folder). The second one is for bulk change of all documents in a folder.

When you select a command, the pop-up offers the choice among four actions (some of them may be grayed out if they do not make sense in the current context):

  • connect to a template: associate a template to an orphan document or change the current template

    You can select a template anywhere in the computer, not only in the "standard" template folder (see Tools>Options\,LibreOffice>Paths`)

  • cut link to template: orphan the document

    The document is no longer associated with the template. Changes to the template will no longer affect the document.

  • deactivate link to the template

  • reactivate link to the template

    I have not tested these commands. From the help, they seem to behave like the update dialog when opening a document with a change template, i.e. you can temporarily suspend styles updates or reallow them.

The help warns against the fact that some changes are not effective immediately. It is thus better to close the document and reopen it. To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

edit flag offensive delete link more

Comments

When I click on the link: DocumentTemplateChanger extension I get a "Page not found" error. Has the link been changed? Thanks

gerbreown2 gravatar imagegerbreown2 ( 2020-10-16 15:38:51 +0100 )edit

You're right. It looks like the extensions site underwent a drastic URL reorganisation. I fix the link.

ajlittoz gravatar imageajlittoz ( 2020-10-16 16:58:18 +0100 )edit
0

answered 2020-02-24 09:30:26 +0100

ebot gravatar image

updated 2020-02-24 09:40:56 +0100

Have a look at:

Tutorial exercise: Styles in Writer - LibreOffice 6.4

Style templates in_Writer - V6

Assign template:

Mark each text. Double-click on the template ″template name″.

If you have provided a document with your desired style, you should then save it as a document template.

I hope it helps you. I wish you success.

If my answer has solved your problem, please click on the checkmark in the circle Bildbeschreibung to the left of the answer for upvote. This will tell the community that the question has been answered correctly.

edit flag offensive delete link more

Comments

With me Windows 10 Home; Version 1909; 64-Bit | LibreOffice, Version: 6.4.0.3 (x64).

ebot gravatar imageebot ( 2020-02-24 09:30:55 +0100 )edit
0

answered 2016-05-06 16:02:28 +0100

akurery gravatar image

Are the paragraph and character styles of your document named the same as the ones of the template?

edit flag offensive delete link more

Comments

Please do not write a question as an answer. Use the comment function for this. Thanks.

ebot gravatar imageebot ( 2020-02-24 09:33:41 +0100 )edit
0

answered 2018-06-01 02:26:29 +0100

ChasVA gravatar image

From the LibreOffice Writer 5.4 Guide, Chapter 10, Working with Templates, pp. 227–228:

Associating a document with a different template

At times you might want to associate a document with a different template, or perhaps you’re working with a document that did not start from a template.

One of the major advantages of using templates is the ease of updating styles in more than one document, as described in Chapter 9, Working with Styles. If you update styles in a document by loading a new set of styles from a different template (as described in Chapter 9), the document has no association with the template from which the styles were loaded—so you cannot use this method. What you need to do is associate the document with the different template.

For best results, the names of styles should be the same in the existing document and the new template. If they are not, you will need to use Edit > Find & Replace to replace old styles with new ones. See Chapter 2, Working with Text: Basics, for more about replacing styles.

1) Use File > New > Templates. In the Templates dialog, double-click the template you want to use. A new document opens, containing any text or graphics that were in the template.

2) Delete any unwanted text or graphics from this new document.

3) Open the document you want to change. (It opens in a new window.)

4) Use Edit > Select All, or press Ctrl+A, to select everything in the document.

5) Click in the blank document created in step 1. Use Edit > Paste, or press Ctrl+V, to paste the contents from the old document into the new one.

6) Update the table of contents, if there is one. Close the old file without saving. Use File > Save As to save this new file with the name of the file from which content was taken. When asked, confirm you wish to overwrite the old file. Or, you may prefer to save the new file under a new name and preserve the old file under its original name.

Caution

Any changes recorded (tracked) in the document will be lost during this process. The resulting document will contain only the changed text.

edit flag offensive delete link more

Comments

This is one area where I think OpenOffice Writer outshines LibreOffice. It is much easier to assign a template in OO via the menu item of that name. I would suggest assigning the template in OO and then editing in LO if you must.

ChasVA gravatar imageChasVA ( 2018-06-01 02:28:37 +0100 )edit

The procedure given above is akin to create a brand new document with loss of some information (such as history). When in need, I use a workaround which is not for the faint of heart.

I save my doc as .fodt (flat XML) and I edit manually the code to alter the reference to the template (caution, the template location is some path relative to the current document). For unknown reason, I sometimes need to alter the template date for the change to be noticed by LO.

ajlittoz gravatar imageajlittoz ( 2018-06-01 08:37:04 +0100 )edit

@ajlittoz Could you give a few more details about the "elements" (in the XML sense) you actually edit for "template" and "template date"? I just created a new .odt file, saved it as .fodt, opened this in a text editor, and searched on "template". The only thing it found was "<config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item>". NB my LO version is 5.1.6.2.

mrodent gravatar imagemrodent ( 2020-01-15 21:30:59 +0100 )edit

@mrodent: sorry, I just noticed your question today (the notification feature has been quite buggy for some time now and does not work satisfactorily on comments).

The XML element is <meta:template … />. However I don't recommend you start patching the .fodt. Try first to work with extension DocumentTemplateChanger. This is much more reliable and less error-prone. Go for a manual patch only if you don't succeed with the extension.

ajlittoz gravatar imageajlittoz ( 2020-02-24 10:38:11 +0100 )edit

@ajlittoz: please provide an answer with the extension!

Mike Kaganski gravatar imageMike Kaganski ( 2020-02-24 10:58:24 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-05-04 01:24:39 +0100

Seen: 1,714 times

Last updated: Oct 16