Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How do I add a new template set

Quote Reply
How do I add a new template set

I've created an copy of the 'luna' folder found in the 'admin\templates' directory and named it: 'luna2'

Using the GLinks web gui, I then (in Build Options ) set the build_default_tpl to the new template set 'luna2'. My goal is to use this copy of luna to build my own custom template set that Glinks will use to generate the directory.

But when I try to view the directory via dynamic view, I loose the CSS and the pages appear with no styling. What have I done wrong?


Quote Reply
Re: [kajukenbokid] How do I add a new template set In reply to
The template stylesheets are in the static/luna directory for the luna template set. You would have to copy that as well. However, if you're just making minor changes to the luna template set, why not just use the luna template set? If you save your changes to the local directory (it will be done automatically if you use the template editor), then the original templates will be left untouched and will be upgraded when you upgrade.

Quote Reply
Re: [kajukenbokid] How do I add a new template set In reply to
1) On your local hard drive in admin/templates, create a folder. Name it 'luna2'.
2) Inside the 'luna2' folder on local hard drive, add a text file named 'tplinfo'. With this for content...
inheritance => '../luna'

3) Copy the 'luna2' folder to admin/templates/ on your server.
4) Rename the file 'tplinfo' to '.tplinfo' on the server. (It is now 'invisible' on server to some FTP clients).

Note: You do not have to copy ANY .html template files to this directory yet. They will all be inherited from luna.

Now the css...
1) In 'build_static_url' directory i.e. www/html/static/, create a folder named 'luna2'.
2) Inside the www/html/static/luna2 directory, add a text file named 'luna2.css' with this for content.
@import url(../luna/luna.css);

That should do it. Any new/overriding styles should be added to luna2.css.
Any templates you want to override should be copied from templates/luna,
and added to templates/luna2.

If you add a folder named 'images' inside static, i.e. static/luna2/images/
you can override images from there.

Hope that helps.

RGB World, Inc. - Software & Web Development.

Last edited by:

rgbworld: Apr 22, 2006, 6:08 AM
Quote Reply
Re: [rgbworld] How do I add a new template set In reply to
Quote Reply
Re: [rgbworld] How do I add a new template set In reply to
FYI, what Chris has stated above is also a valid way of doing things (I would do it that way). However, it's more complicated and requires some understanding of how things work.

And to expand on this method, the reason why images still work is because:

1) Images specified in the templates using <%Links::image_url(...)%> will use template inheritance and use the images from the luna/images directory if they don't exist in the luna2/images directory.

2) Images specified in the luna/luna.css file will use the images from luna/images because relative urls in a CSS file are relative to the location of the CSS file itself. If you use relative paths for images in your luna2/luna.css file, then they will be relative to the luna2 directory.

Also, if you are only looking to change the style of the templates, you can use the built in template theme support. If you create a stylesheet in the static template directory, then that theme will become an available template set. For example, if you create a foo.css file in the static/luna directory, then you can use the template theme "luna.foo".