"Stylesheet Switcher"

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

"Stylesheet Switcher"

Post by cmb » Thu Aug 07, 2014 1:26 pm

Hello Community,

since the early days of the pluginloader there is the plugin TemplateShift, which has later been rewritten and modernized to become TemplateSwitch. Both plugins are very useful for template designers to present their templates, but apparently they are not too useful for normal CMSimple_XH sites--at least I've rarely seen the plugins used on normal sites. Maybe it is simply too expensive to maintain several templates.

However, at least since HTML 4.01 (December 1999) it should be possible to specify alternative stylesheets, which could be selected by the visitor (some browsers allow this with built-in options, such as Firefox [View->Website Style]; for other browsers there might be add-ons available). Making use of this feature might be a nice improvement for templates, and it can already be used by modifying the template and offering multiple stylesheets. For instance, I've picked "n3005" form Torsten.Behrens (because there are already several alternative stylesheets included), and modified template.htm:

Code: Select all

    <link rel="stylesheet" title="blue" href="<?php echo $pth['folder']['template'];?>style.css" media="screen">
    <link rel="alternate stylesheet" title="aqua" href="<?php echo $pth['folder']['template'];?>style-1.css" media="screen">
    <link rel="alternate stylesheet" title="brown" href="<?php echo $pth['folder']['template'];?>style-2.css" media="screen">
    <link rel="alternate stylesheet" title="green" href="<?php echo $pth['folder']['template'];?>style-3.css" media="screen">
    <link rel="alternate stylesheet" title="lime" href="<?php echo $pth['folder']['template'];?>style-4.css" media="screen">
    <link rel="alternate stylesheet" title="purple" href="<?php echo $pth['folder']['template'];?>style-5.css" media="screen">
That works really nice (tested in Firefox 31.0).

However, this solution has the drawback that the user selection is gone after navigation to another page. It might be nice to have a small plugin or addon similar to TemplateSwitch that is able to let the user choose the desired style and stores this selection in a cookie, and uses this cookie to rearrange the alternate stylesheets.

Thoughts?

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: "Stylesheet Switcher"

Post by svasti » Thu Aug 07, 2014 3:46 pm

I thought you are giving us template designers a new plugin... with a big XH added to it. :lol:
Nice, let's put it in the demo.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: "Stylesheet Switcher"

Post by cmb » Thu Aug 07, 2014 6:35 pm

svasti wrote:I thought you are giving us template designers a new plugin... with a big XH added to it. :lol:
Well, actually I started programming Themeswitcher_XH in May, but I have been interrupted... Probably there are more important things to do. However, just recently there was a discussion on comp.infosystems.www.authoring.stylesheets about such alternate stylesheets, so I wanted to bring the topic up here, to see if there's any interest.
svasti wrote:Nice, let's put it in the demo.
Well, we would need alternate stylesheets for the templates, and of course alternate stylesheets can't handle different templates.
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: "Stylesheet Switcher"

Post by svasti » Thu Aug 07, 2014 7:44 pm

Somehow I don't think that alternative stylesheets are high on the agenda. Sorry I thought it's going to be a new template changer.

Post Reply