Gossamer Forum
Home : Products : Gossamer Links : Discussions :

themes - wide and standard view?

Quote Reply
themes - wide and standard view?
I'd like to create a second theme, that will give people who run on modern screens, the ability to run in 1200 pixel mode, not just 800. With most screens in the 1600 range already, 800 wastes a lot of potential screen space, but a full 1600 would probably be "too much" at once.

At first, it would just add the left sidebar as an extra column with additional data, options, and such. Headers and footers would just expand. Later on, I'd like a completely different set of templates customized for higher resolutions.

What would be really cool, is if there is a way for it to autodetect the screen size, and add the left column if the screen was wide enough, or widened enough. This would be only from the "home" page, obviously, and then by a toggle, unless a user set a preference. (I don't know if it can be automatically checked - I know browser windows can be resized, but not if their size can be 'read').

So, two questions:

1) how to set up the second theme in a user-selectable manner

2) how to make it automatic, if technically possible. (or, at least, when a user logs in, if it could reset their browser window to their selected resolution).


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] themes - wide and standard view? In reply to
I don't have something you can cut and paste because I don't know of one ready made and it would take a while to code out, but this would be pretty easy to do using javascript. The Links3 luna templates are perfect for this because the layout totally depends on which sheet gets loaded.

Basically, you create two style sheets, one for higher resolutions, one for your default visitor. Then you use a javascript to detect the browser window size (note that this isn't quite the same thing as detecting screen resolution) and have it write a different css link to the page based on the detected size.

It would also be possible to use cookies to give visitors a choice of displays. Give users a way to select a preferred display that gets saved to a cookie. You can then use an if/else to first look for the cookie and if found write the corresponding style sheet. If not found you have it go on to the automated selection based on detected window size. If that fails (i.e. js not enabled) you use the noscript section to plop out your default CSS link.

Sounds more complicated than it is I assure you. Indeed, none of these functions is really all that exotic and you can probably hobble it together from cut and paste javascripts that have similar functions pretty easily.
Quote Reply
Re: [fantasyman] themes - wide and standard view? In reply to
Trouble is I really avoided javascript all these years, so I don't know where problems can occur. I did a brief search for some scripts, but didn't see any that did quite what I needed/wanted.

Also, the new links has support for "themes" built in, but I haven't quite figured out how to do it on a per-user, per-category basis "properly" as it were. It would be nice to be able to load new "themes" on a category-by-category basis, not new templates, per se, but a new layout/css style.

Being able to allow users to select their layout seems to be one of the big benefits of the new template system, but, *how* to do it, in a real-world implementation is tripping me up.

I added category images back in, and got the link.html to display the mini images for a specific installation, and got the "thumbshots" working on another site, so I'm getting the knack for some basic css, but I still haven't figured out how to get links to show "different faces" semi-automatically.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] themes - wide and standard view? In reply to
Well, I got intrigued by the idea so I put something together. Its not exactly what you are hoping for I guess, but its the idea I presented. There should be plenty of comments everywhere so you can see how you would use it.

The javascript and cookie portion is old school stuff and 4.0 browsers won't choke on it, but note that because it relies on CSS its really intended for more modern browsers.

I have attached a zip with all the relevant files, just unzip them to a single directory for a working example. Here's a live version if you want to get an idea of how it works first.

http://speculativevision.com/cookiecss/

I have never really tried to use different themes in LinksSql so I'm not sure what might be involved. My understanding is that the primary method is to pass a different template name to the dynamic page generation script yes? If so, I'm sure it is possible to use perl to set and read a cookie then alter the links to use that cookie's value for the page template name as you move from page to page. Unfortuately I don't know perl or the links scripts well enough to tell you how to do that.
Quote Reply
Re: [pugdog] themes - wide and standard view? In reply to
Take a look at this post to get a gist of how the built in themes work.

However, I don't think themes will help that much with what you're trying to do. Take a look at: http://www.alistapart.com/articles/alternate for switching between style sheets and remembering the selection in a cookie. You could have the regular style sheet and one named 'wide' and just allow the user to choose which one they want (or write some extra javascript to look at the window size).

Adrian
Quote Reply
Re: [brewt] themes - wide and standard view? In reply to
I thought themes were a way to load a different style sheet for different reasons. I'm not looking for two completely different template sets, [yet].

In that case, a theme that has the left panel enabled, and one that doesn't, would be fairly simple. As I said, this first-try is just to enable a 3-column view, without making the center column so tiny, and making a bit better use of the larger screens today.

I need to check out the other posts, to see if this will work.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.