Bug 89286 - Create possibility to replace template attached (where it is based upon) to a Writer document
Summary: Create possibility to replace template attached (where it is based upon) to a...
Status: RESOLVED DUPLICATE of bug 50699
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Templates
  Show dependency treegraph
 
Reported: 2015-02-10 12:01 UTC by Patrick Smits
Modified: 2018-01-13 14:40 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Smits 2015-02-10 12:01:48 UTC
Although it is possible to create a new Writer-document based on a template, it is not possible to change the attached template with another one.

Use case:
Suppose you work in a Writer document based on template_a. Later on, somebody comes up with another template, template_b. But as far as I can tell, there is no documented way to attach template_b to the existing document and have all styles updated. Chapter 10 of the LibreOffice Writer Guide [1] doesn't even mention this scenario, whereas it is a quite common use case in private and corporate environments. It really should be default functionality.

Up to early 2015 there was a quite popular extension that handled this: [Template Changer} [2]. It added two items under File/Templates: [i] Change template [directory] [ii] Change template [document]. However it broke with almost every release of LO. After the upgrade to 4.4.0.3 it stopped working again. Please consider to make this stock functionality.

[1] Chapter 10: Working with Templates:
https://wiki.documentfoundation.org/Documentation/Publications#LibreOffice_Writer_Guide
[2] https://bugs.documentfoundation.org/show_bug.cgi?id=50699
[3] LO 4.0 broke the 6th most popular Writer Extension:
http://ask.libreoffice.org/en/question/14483/lo-40-broke-the-6th-most-popular-writer-extension/
Comment 1 Cor Nouws 2015-02-10 12:47:41 UTC
Hi psmits,

thanks for writing and explaining.

(In reply to psmits from comment #0)
> .... But as far as I can
> tell, there is no documented way to attach template_b to the existing
> document and have all styles updated. 

For clarity, can you please say in which way the possibility to import styles from other documents/templates falls short for your needs?
(See dialog Styles and Formatting, icon top right, click-hold...)

Regards,
Cor
Comment 2 Patrick Smits 2015-02-11 08:40:17 UTC
Hi Cor,

Thanks for your reply. I was unware of this option, but it seems to fix it for me. However... I still would have expected the same option under File / Templates (since that is where all the template managing action takes place).

For now I think updated documentation in [1]: "Associating a document with a different template" (Page 11) will suffice. If I manage to find out how to contribute I gladly would. So any help there would be appreciated ;-)

If I run into new problems with the option in the Styles and Formatting dialog, I will create a new bug. After minimal testing it seems to do what I want though ;-)

Just out of curiosity: How long has this option been there, since I haven't noticed it before?

[1] Chapter 10: Working with Templates:
https://wiki.documentfoundation.org/Documentation/Publications#LibreOffice_Writer_Guide
Comment 3 Patrick Smits 2015-02-12 00:06:41 UTC
Hi Cor,

I was wrong in my previous post, your suggestion actually is different from what I meant. It only imports new styles in the document, but the attached template (as visible in File/Properties/General tab  --> Template) remains the same.

I'm looking for a way to assign a new template to a document, not just updating the styles. Not only will all styles and formatting be loaded from that template, but the document will also behave as if it was created using that template. This has several advantages (explained below).

To test:
1. Create a template template_a.ott with the following information in File/Properties/Description tab --> Title=Template A.
2. Create another template template_b.ott with the following information in File/Properties/Description tab --> Title=Template B.
3. Open Writer and go to File/Templates/Manage. You're now in the Template Manager.
4. Click on My Templates
5. Click on Import and import both template_a and template_b from where you saved them.
6. Create a document based on Template A by double clicking on My Templates, click on template_a  and  then Open.
7. Save this document as test.odt
8. Check in File/Properties/General tab  --> Template that it's based on Template A.

Now change a style in template_a and save it again:

9. In Writer go to File/Templates/Manage and double click on My Templates.
10. Click on template_a and then Edit.
11. Make a random style adjustments via the Style and Formatting dialog and save the template via File/Save.
12. Close Writer.
13. Open test.odt.

You'll notice that once you open the document you will get the following message [[1], page 7]:

"The template 'template_a' on which this document is based, has been modified. Do you want to update style based formattings acording to the modified template?'

So one of the advantages of using templates is that it updates all documents that are based on it. This is exactly what you would expect.

So far so good, but suppose you receive this document from somebody by mail and want to give it the default look of your documents based on template_b?

As far as I can tell the only way to do this is by using the extension Template Changer [2]. You can assign Template B to our test.odt by going to File / Templates / Assign Template (current document) and use template_b. To verify check File/Properties/General tab  --> Template.

If I follow your suggestion and 
14. Go to the dialog Styles and Formatting
15. click on the icon top right
16. Click-hold & click "Load Styles"
17. Click on template_b

the styles from template_b are indeed imported, but the document will still be based on the same template_a that our original document was based on. To verify check File/Properties/General tab  --> Template.

So yes, there is a difference. 

BTW, just yet, I noticed there already is a similar bug report in bug 60660 from 2013 on which you already commented. So this one actually is a duplicate. However bug 60660 was closed as a RESOLVED DUPLICATE because it was supposed to be a dupe of 50699, but it really isn't.

Another argument against closing this one is that the original developer of the extension Template Changer has abandoned the extension, so bug 50699 will not be receiving the attention it needs. I could fix it once, but I may not be able to in the future. Besides that, I strongly believe this should be stock functionality, not added via an extension. I hope the LO developers agree.



[1] Chapter 10: Working with Templates:
https://wiki.documentfoundation.org/Documentation/Publications#LibreOffice_Writer_Guide

[2] See comment 14 @ https://bugs.documentfoundation.org/show_bug.cgi?id=50699 to get the most recent version.
Comment 4 Cor Nouws 2015-03-04 08:30:06 UTC
Hi Patrick,

(In reply to Patrick Smits from comment #3)

> I was wrong in my previous post, your suggestion actually is different from
> what I meant. It only imports new styles in the document, but the attached
> template (as visible in File/Properties/General tab  --> Template) remains
> the same.

> So one of the advantages of using templates is that it updates all documents
> that are based on it. This is exactly what you would expect.

> Another argument against closing this one is that the original developer of the
> extension Template Changer has abandoned the extension, so bug 50699 will not
> be receiving the attention it needs. I could fix it once, but I may not be able
> to in the future. Besides that, I strongly believe this should be stock
> functionality, not added via an extension. I hope the LO developers agree.


Yes that is all true. 
  > Set to new.

Thanks for the clear explanation, and sorry for being late with responding,
Cor
Comment 5 Thomas Lendo 2017-08-22 11:41:41 UTC
Is this a duplicate of bug 50699 - Template Changer: Allow ability to change a document's associated template, isn't it?
Comment 6 Patrick Smits 2017-08-22 12:08:31 UTC
No it is not, bug 50699 is about the *extension* Template Changer, whereas this really should be core functionality when working with templates.

Although I've commented on bug 50699 and will keep the extension up to date for as long as I can, the extension is just a band-aid. The real fix is to implement this functionality in the LO Template Manager.

I've worked with office suites since MS Office 97. IMHO the way MS Office XP from 2001 and Office 2003 handled this, is still unmatched. Styles were added on the fly, Renaming was just a right click away, saving and replacing a breeze. I'd love to see that coming to LO. It's what keeps me motivated answering and filing these bug reports. It's the key thing missing in my LO workflow.

If needed, I can create a screencast to show how Office XP handled it.
Comment 7 Thomas Lendo 2017-08-22 18:25:17 UTC
(In reply to Patrick Smits from comment #6)
> No it is not, bug 50699 is about the *extension* Template Changer, whereas
> this really should be core functionality when working with templates.
Sorry, but no. Component and bug description in opening comment show that the bug is asking for an built-in solution based on or in example of the extension. Therefore this bug is a copy of that wish.

> Although I've commented on bug 50699 and will keep the extension up to date
> for as long as I can, the extension is just a band-aid.
Very cool and thank you very much for your work!

> If needed, I can create a screencast to show how Office XP handled it.
Screenshots or screencast would be helpful.
Comment 8 Heiko Tietze 2018-01-13 14:34:22 UTC
(In reply to Patrick Smits from comment #6)
> No it is not, bug 50699 is about the *extension* Template Changer, whereas
> this really should be core functionality when working with templates.

Right, the discussion meandered there a bit but actually the request is to bring the same functionality into the core development (Jon changed component from extension back to Libreoffice).

*** This bug has been marked as a duplicate of bug 50699 ***