Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Template themes and CSS changes in GLinks 3.0 RC

Quote Reply
Template themes and CSS changes in GLinks 3.0 RC
We've been looking into ways of making themes and the management of the style sheets easier, and this is what we've come up with (and is going to be included in the RC release, which by the way, will be delayed till tomorrow). Please note that you don't have to use this system, and the previous system of specifying t=<templatename> still works.

We have deprecated the use of the build_images_url directory in favour of keeping all static files (images, css, javascript, etc) in a single directory. We have added a build_static_url and build_static_path (more on this later). The layout in this path is as follows:
Code:
/path/to/static/
+ luna/
+ images/
+ ...
+ luna.css
+ luna_core.css
Firstly, core.css has been renamed to luna_core.css and custom.css has been renamed to luna.css. luna.css inherits its styles from luna_core.css with an @import declaration at the top of the file, and so any styles declared in this file will override any defined in luna_core.css like before.

Themes allow you to use a single template set with multiple style sheets. A theme uses a separate css file (you can inherit from the luna_core.css or luna.css files if you wish), and images in the templates (images referenced in the style sheets are your responsibility) also use simple inheritance. Image inheritance is done by generating the image url's instead of making them static. The code checks if the image exists in build_static_url/<template set>/images/<theme name>, then in build_static_url/<template set>/images. This allows you to use the base template's image, and override the images that you need for the theme. For example, if you created a 'summer' theme, and you wanted to override the paging images, then the layout would be like this:
Code:
/path/to/static/
+ luna/
+ images/
+ summer/
+ paging-first.gif
+ ...
+ paging-first.gif
+ ...
+ luna.css
+ luna_core.css
+ summer.css
Where /path/to/static/luna/images/summer/paging-first.gif would be used instead of /path/to/static/luna/images/paging-first.gif.

I hope this wasn't too confusing! I'll talk about specifics after we release the release candidate.

Adrian
Quote Reply
Re: [brewt] Template themes and CSS changes in GLinks 3.0 RC In reply to
Hi,

Since I am a non-programmer, can you please advise if there are any benefits to switching from the "old" templating system to the new CSS-based template/theme system?

TIA,
ATKOgirl
Quote Reply
Re: [ATKOgirl] Template themes and CSS changes in GLinks 3.0 RC In reply to
The 'old' template system is essentially the same as the 'new' one. Only with the 'new' template system, some features have been added to make themes easier to implement. What the theme system will allow you to do is to create multiple themes/styles for a single template set. You can do this without support in the program, but it's just a little easier.

Adrian
Quote Reply
Re: [brewt] Template themes and CSS changes in GLinks 3.0 RC In reply to
   
So the themes are sort of like sub-templates systems within one large template system?

Sounds pretty interesting.

We will be implementing a new site with G-Links, so I haven't even played with it yet. Once it is "final" we'll start developing.


Thanks!

ATKOgirl
Quote Reply
Re: [brewt] Template themes and CSS changes in GLinks 3.0 RC In reply to
Hi.

Is the RC expected today?
Also, would it upgrade on beta or it has to be 2.2.x -->RC?
If live site is upgraded with RC then would all subsequet updates be thru the Update feature or would that only stabilize after the stable version is released?

Thanks

Thanks
HyTC
==================================
Mail Me If Contacting Privately Is That Necessary.
==================================
Quote Reply
Re: [brewt] Template themes and CSS changes in GLinks 3.0 RC In reply to
Adrian,

I like the concepts... I've spent some time in some new CSS books, including the new book from the CSS Zengarden folks.

Providing the browser will play nice, the cascading effect of luna.css inheriting from luna_core.css.

It would be nice, via a plugin or another method, to provide a means for a category to have a theme override. Subcatagories could have option to inherit theme from its parent.

So if I have a category of A then I could have a red themed color..... and CC, which is a sub category of C could be blue themed color based on C using a theme override.


btw... 3.0 will be XHTML 1.1 Strict compliant right?? <grin>

(Please send Tony Soprano to W3C on that one... dang if thats a pain to get a site to validate).

Keep up the good work up north.

Lance
Bowlingzone.com
Quote Reply
Re: [lancerasmussen] Template themes and CSS changes in GLinks 3.0 RC In reply to
I've just finished going through and switching all the templates to an even better layout. Now you can easily make your site use a 3 column, 2 column or 1 column layout by editing the luna.css file (and of course it's cross browser compatible!). It also fixes some of the limitations of the previous layout. However, this means that the people who have already customised their templates will have to do it again (well it is a beta!). Shouldn't be too much trouble doing so though.

In Reply To:
Providing the browser will play nice, the cascading effect of luna.css inheriting from luna_core.css.
I've been testing everything in multiple browsers (win: ie5, ie5.5, ie6, opera 7.x, mac: safari, ie5, linux: firefox 1.0.1), so it should be fine.

In Reply To:
It would be nice, via a plugin or another method, to provide a means for a category to have a theme override. Subcatagories could have option to inherit theme from its parent.
Already thought of that and it's already supported. If Category_Template uses the <template set>.<theme> format then it will use the theme. Note that you can't name your theme html or htm since those denote templates with Category_Template (if anyone is using something else for template names you should let me know [ie. not *.htm or *.html]). Everything else without a . in it means it's a template set.

In Reply To:
btw... 3.0 will be XHTML 1.1 Strict compliant right?? <grin>
Actually, due to the way Gossamer Links modifies the output html, we can only make things transitional compliant (and plus it's already a pretty big jump to xhtml for most people, so we don't want to force them to code in Strict). You also probably don't want XHTML 1.1 since it's requires things like making the Content-Type of the document application/xhtml+xml, which many browsers (eg. Internet Explorer) do not support. However, XHTML 1.0 allows for sending documents as text/html.

In Reply To:
Keep up the good work up north.
Thanks!

Adrian

Last edited by:

brewt: Mar 24, 2005, 1:26 AM
Quote Reply
Re: [brewt] Template themes and CSS changes in GLinks 3.0 RC In reply to
Well you've been busy :
Quote:
I've been testing everything in multiple browsers (win: ie5, ie5.5, ie6, opera 7.x, mac: safari, ie5, linux: firefox 1.0.1), so it should be fine.

I think one of the main issues will be finding the courage to move towards a CSS type layout because many sites will have to like you go through the whole redesign process in order to make it a smooth move from their present design to your new and nifty CSS design.

And not all of us are as quick as you in finding solutions like the 1, 2 or 3 column design in such a short time Wink

Can't wait to see the RC

John
Significant Media
Quote Reply
Re: [brewt] Template themes and CSS changes in GLinks 3.0 RC In reply to
 
In Reply To:
I've just finished going through and switching all the templates to an even better layout. Now you can easily make your site use a 3 column, 2 column or 1 column layout by editing the luna.css file (and of course it's cross browser compatible!). It also fixes some of the limitations of the previous layout. However, this means that the people who have already customised their templates will have to do it again (well it is a beta!). Shouldn't be too much trouble doing so though.


Very nice thinking there... Allowing column flexability is "a good thing". (grin)

In Reply To:
I've been testing everything in multiple browsers (win: ie5, ie5.5, ie6, opera 7.x, mac: safari, ie5, linux: firefox 1.0.1), so it should be fine.

That pretty much covers the majors... May want to check PDA's, etc, but not critical



In Reply To:
Actually, due to the way Gossamer Links modifies the output html, we can only make things transitional compliant (and plus it's already a pretty big jump to xhtml for most people, so we don't want to force them to code in Strict). You also probably don't want XHTML 1.1 since it's requires things like making the Content-Type of the document application/xhtml+xml, which many browsers (eg. Internet Explorer) do not support. However, XHTML 1.0 allows for sending documents as text/html.
I agree. XHTML 1.0 Transitional will help a lot in terms of standards... I sometimes like to beat my head bloody and try for 1.0 Strict or 1.1 Transitional... The biggest thing/culprit is insuring that GT's output can play nice and achieve as close to Strict / 1.1 standards as possible. I would rather fail validation from W3C because of my template no-no's vs GT having mixed case tags or non-closing tags (gotta remember those dang <br />'s and even meta's must be closed. Images should all have alts, even if using spacer images. While 3.0 may not be supporting PHP, it would be good to insure support of generating files with default php extension. This way I can inject some php in the templates as needed. Lance Bowlingzone.com
Quote Reply
Re: [lancerasmussen] Template themes and CSS changes in GLinks 3.0 RC In reply to
In Reply To:
I agree. XHTML 1.0 Transitional will help a lot in terms of standards... I sometimes like to beat my head bloody and try for 1.0 Strict or 1.1 Transitional... The biggest thing/culprit is insuring that GT's output can play nice and achieve as close to Strict / 1.1 standards as possible. I would rather fail validation from W3C because of my template no-no's vs GT having mixed case tags or non-closing tags (gotta remember those dang <br />'s and even meta's must be closed. Images should all have alts, even if using spacer images.
A lot of that is just due to a lot of legacy code and html being generated in the code. With Gossamer Links 3.0, we've gone through and moved as much of the html generation out into the templates (while leaving some of the old code in for backwards compatibility). From what I've seen, the only thing that's preventing it to validate Strict is the way Gossamer Links dynamically rewrites pages - it adds in hidden tags into forms, and input's aren't allowed to be directly inside forms (even input type="hidden"). However, the templates (minus any html that have been submitted by users) should XHTML 1.0 Transitional validate - let me know if you find any pages which don't. The CSS however, won't validate since there are some hacks and usage of CSS2.1 rules that the validator doesn't recognise.
In Reply To:
While 3.0 may not be supporting PHP, it would be good to insure support of generating files with default php extension. This way I can inject some php in the templates as needed.
I don't see why you would have any problems doing so.

Adrian
Quote Reply
Re: [brewt] Template themes and CSS changes in GLinks 3.0 RC In reply to
Is there a newer version than glinks-2.99.0.tar.gz?

I went to download area and thats all thats listed.

Also, I have live beta running, so do I need to restore to 2.x and install from there or can I get to RC from beta?

A little guidance please :-)

Thanks,
Chris

RGB World, Inc. - Software &amp; Web Development.
rgbworld.com

Last edited by:

Alex: Mar 26, 2005, 4:50 AM
Quote Reply
Re: [rgbworld] Template themes and CSS changes in GLinks 3.0 RC In reply to
I believe the RC (which will be 2.99.1) won't be released until Monday. You can upgrade from 2.99.0 to 2.99.1, but there's been quite a few html and css changes, so if you've customised things a bit, you'll need to redo some of the changes. There shouldn't be any major changes in the templates or css after the RC release, so you shouldn't have to go through that again :)

Adrian
Quote Reply
Re: [brewt] Template themes and CSS changes in GLinks 3.0 RC In reply to
Actually due to the nice job you guys are doing, I have edited only a half-dozen templates and the css.

With 2.x, I had to edit every single template file. That took me 6 weeks. Then I jumped on the beta, seems I wasn't quite finished getting 2.x completely running. I only purchased in Jan, so it has been 3 months of installs and updates and BIG changes. I can't wait to land on some code thats gonna stay for a while :-)

imho, the new templates and css system are a great improvement and makes for a LOT less code editing.

Cheers,
Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com