Issue when creating templates on Linux Mint

Hello everyone,
I have a template I use all the time for Writer (included in this post), but I have an issue in the way it is managed by the OS.
When I save a template, it is saved in /home/Templates as an OTT. However, as the result, when I right-click in the file explorer to create a new writer file, it creates a OTT, not an ODT, which is a bit annoying as I need to open the OTT, save it as an ODT, and remove the OTT I just created.
I can’t just replace in the Templates directory the OTT by an ODT, as LibreOffice will think I deleted the template.
Any way to fix this please ? Thanks in advance for your replies

OS : Linux Mint 22.1 (Cinnamon)
LO latest stable version
File(s) saved in ODT
LibreOffice Writer.ott (23.2 KB)

Do you right-click on the template icon or in blank space in the file explorer? (By the way, which is your desktop manager; GNOME, MATE, KDE Plasma, …?)

I never do that because it creates an empty file which is not attached to a template. Since you’ll anyway process the file with Writer, launch Writer and File>New>Templates so that the link with the template is created and your document benefits from automatic updates when your template changes.

PS: you can improve your template. Presently, you must manually apply Univ numbering list style when you add a List Contents paragraph. Attach the list style to the Outline & List tab of List Contents. This eliminates a direct formatting step. Also, since the list style is integrated to the paragraph style, changing the paragraph style after last list item, e.g. to revert to Body Text, also removes list style application (without manual operation).

My usual way is a double (left) click on the template to get a new “unnamed.odt” from the template.
.
A right click I use without any selected files in the folder, from an empty space in the folder.
.
But I have to admit: I never used Cinnamon…

My desktop environment is Cinnamon, as stated in the original post (though I guess not a lot of people use it)
I right-click in a blank space in the file explorer, go to “Create a new doc.” and I have my LO templates there
Currently I just launch the Writer app directly, which gives me the aforementioned template (as I’ve set it by default), but I’d like to use the “file explorer” way, like I used to do on W10 without issues, so that I don’t need to set where the file is saved

Yeah opening the OTT file works for me to create an ODT, but I don’t find it that practical because to access the template file from the file explorer, I have to go to Home, then into the Templates folder (which is kind of a step too far, not one that casual users would usually do)

Your desktop environment has no idea about actual apps’ templates. In its own template directory, there are intended to be simple files, that the DE copies verbatim to the places where you want. And so, if you put an OTT there, the OTT (not only with the extension, but also with the respective MIME type and ODF type, encoded internally) is copied to the destination.

Just put an ODT to your Cinnamon’s templates directory.

Ok, I understand

I tried that as well ; but of course I need to keep the OTT file in the folder, otherwise LO will think the default template is gone
So that means I have to keep both an ODT and an OTT in the Templates folder ; however, if both have the same name, they are indistinguishable in the drop-down menu
Do you know if XFCE manages this better ? I’m considering switching to LM XFCE

??? LibreOffice’s own templates are stored independently of Cinnamon’s - unless you tweak the directories manually, which would be wrong in this case.

Well looks like it isn’t lol : even though I didn’t change anything (didn’t even know one could change the LO templates directory), any template I create is saved in the Templates folder
In other words, any template I create appears in the drop-down menu of the file explorer

This is not the best method because it misses a key point. When you do so, you effectively create an Untitled1.odt document but it is fully independent from the template. In other words, future edits on the template will not be forwarded to your document.

You don’t need to go to the templates directory to use them. Iff your template was saved with File>Templates>Save as Template, it is stored in the templates directory and also registered with Writer (Writer is aware of its existence). Then, launch Writer (this should be a one-click job as Writer should be available in the Applications menu or screen) and File>New>Templates with one click on the target template.

When so created, the document keeps a link with the template. When the template is modified, the changes can be forwarded to the document next time you open it; thus your formatting is always up-to-date with the template.

There is no search in the file hierarchy to access the template nor another traversal to revert to the initial directory. Everything is handled at save time.

How specifically do you create (store) your templates in LO; and how specifically do you use (access) them from within LO?

I very much suspect, that when you write “LO will think the default template is gone”, that actual thing that you see is that a file shown in your recent file list is said missing (not the actual LO default templates from its Templates view).

This quote is not mine sorry, I still struggle with quotations on these forums lol

Anyway, I think I did go to File>Templates>Save as Template to create the OTT
I understand your File>New>Templates method, but what about the default template ? With the latter, I don’t need this method right ?

I created the template by using “Save as template”, and I’ve set it as the default one ; templates are stored in the Templates folder, created by default on Linux Mint CInnamon
Then, for any new ODT file (by launching the Writer app), I don’t need to do anything as it uses the default template immediatly
When I delete the OTT file set as the default template, then launch Writer, it warns me that the default template is gone

Can you show a screenshot of your LO’s OptionsLibreOfficePaths, expanded to see what’s there in the internal paths as well?

You can designate any template as the default template in File>Templates>Manage Templates. If your custom template becomes the default, File>New>Text Document attaches the new document to your template.

Creating a new document with the file browser never links this file with any LO template, even if the extension is .oxy, at least under Linux.

Oh ok
So this template being the only one I use for most of my docs, I shouldn’t use the “file explorer” way to create ODT files ?

Hmm, are you sure you didn’t yourself add that /home/<username>/Templates there? If not, that’s your friendly (and clueless) distro maintainer…

OTOH - you use Mint; I have an Ubuntu here - and they use the same package. Mine has this:

and no DE/OS templates there - so I’m very much confused, why you have an outright incorrect template directory setup.

This creates an empty file, containing 0 byte. Linking an .odt to a template requires XML directives to tell Writer which template to use. This XML metadata can’t be written by the file manager (it would have to know every possible file encoding variant for any application!). Therefore such an empty file takes its true personality only after the application has written something inside it.

So create your document from within LO. It is faster and more reliable.

I’ve never been to this submenu, so no I didn’t do anything
Do I need to remove what’s written on the Templates line after the semicolon ?