[scribus] Editing templates

Nik scribus at babel.homelinux.net
Mon Jul 21 07:06:54 CEST 2008

Hi All,

Q: The simple question is: how do I edit an existing Scribus Template?

Q: Which leads (indirectly) to a corollary question: would it be a good 
idea to provide a "Manage Templates" window, or at a minimum a "Delete 
Template" option?


I've tried two different approaches to editing an existing template, 
both of which produce a useful result, but both of which also have problems.

I've searched the FAQ and Wiki and not found anything, so if the answer 
is out there and I've missed it, please accept my apologies.

I've tried this on various versions of Scribus 1.2 and 1.3, running on 
various versions of Fedora Core.
Most recently I tried this on Scribus 1.3.3.something, on Fedora Core 4.

The two approaches I've tried are:

1. edit the template document itself:

1a. select "File | Open" and select "~/.scribus/templates" (eg 
/home/nik/.scribus/templates) and open the desired (template) scribus 
1b. edit merrily away and then save

2. edit a document based on the template and overwrite the original 

2a. select "File | New from Template" and select the desired template
2b. edit merrily away, and save (just to be sure)
2c. select "File | Save as Template", enter the original template name 
and click OK.

I can't make either approach work in a way that I could give to a 
non-expert computer user.

Problems with approach 1:
The first problem with option 1 is that it is *not* at all easy to open 
a file in ~/.scribus. Being a hidden directory it doesn't show in the 
file browse windows, and I have to enter ".scribus" manually in the 
browser. Once I'm there, it's pretty easy to find the correct template 

The second problem is that saving the updated template file doesn't seem 
to update the template thumbnail, nor does it seem to handle any newly 
added images properly - meaning that an image that was added to an 
existing template shows as missing in any document created from that 

Problems with approach 2:
The main problems with approach 2 involve issues with template management.
The first problem is that even when a template is saved to the same name 
as an existing template, a new definition is created in the template 
index (".scribus/templates/templates.xml"). So each time I update a 
template in this way, I get an extra (duplicate) entry show up in the 
template browser.

The second problem involves newly added images. I haven't yet 
established exactly all the things that don't work, but newly-added 
images would show as "missing" when a new document was made from the 
modified template.

In the end I copied all the images into the .scribus/templates folder 
I tried doing this with the "File | Collect for Output". This copied all 
the images to .scribus/templates, but changed all the paths in the 
template document to ".", which causes any document created using this 
template to fail to find the images.

In the end I just copied the images to .scribus/templates *but* set the 
template document to link to the the images from some *other* folder, 
because any images that I linked to "~/.scribus/templates" were ignored.

The only reliable solution I found for the new images was to *delete* 
all files related to the original template before saving the new 
template (this is why it's a *really* good idea to save the file in step 
2a above).

So, my process for editing a template this way is:

2a. select "File | New from Template" and select the desired template
2b. edit merrily away, and save (just to be sure)
2c. delete ~/.scribus/templates/<original-template-name>.*
2d. edit "~/.scribus/templates/templates.xml" and delete the entire 
<Template>...</Template> entry for the edited template
2e. select "File | Save as Template", enter the original template name 
and click OK.

This results in a newly saved template with the correct thumbnail, and 
all images functional.

At one stage in my trial-and-error process I ended up with a template 
that could not be changed. I would save the template document, and yet 
when I created a document from that template, the changes would not be 
there. In the end I found that I had both a "template-name.sla" and a 
"template-name.sla.gz" in ~/.scribus/templates, and my changes were 
going into one, and Scribus was reading back from the other. This was 
solved by steps 2c. and 2d. above.

So back to my original question:

Q1: What is the way to edit an existing template so that it doesn't 
create a duplicate, the template thumbnail is updated, and any newly 
created image frames link correctly to the image when a document is 
created from the template.

And my original proposals:
P1: From my experiences with this, it would be very helpful to have the 
ability to delete an existing template. This not only helps solve 
problems in editing templates, but allows users to remove old templates 
that are no longer used and are just cluttering up the templates folder.

P2: From proposal P1 above, it would seem that a "Manage Templates" 
window would be really handy, allowing users to see their templates, 
delete unused ones, get info and properties on them, rebuild the 
thumbnail, and perhaps even check the image links, etc.


More information about the scribus mailing list