Re: php selecting multiple stylesheets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 08, 2010 at 10:22:07AM +0000, Ashley Sheridan wrote:
[...]
> > in CSS there is also the concept of 'alternate stylesheets' build in. A
> > page can basically specify as many stylesheets as it wants where one is
> > default and all others are 'alternate'. The browser will then offer menu
> > entries for the user to choose from. Ie in firefox you can choose the style
> > from the menu at: View -> Page Style -> ...
> > 
> > Here's how it works in detail:
> > http://www.w3.org/Style/Examples/007/alternatives (note that this site also
> > has alternate styles available)
> > 
> > PHP could be used to define the default style sheet on a per
> > user/application setting basis...
> > 
> > stephan
> > 
> > 
> > 
> 
> 
> The only problem relying only on this method is that not all browsers
> are compatible with it, and of those that are, none remember the choice
> a user makes from page to page, so they'd have to reselect it upon each
> page visit

yes, it can't be relied on it.

I made the primary method for configuring the theme an user setting in the
application. This setting is very easy to implement as it just defines the
theme that is shown first and without 'alternate' attribute in each page header
(unaware browsers will take this too as its the standard syntax). All other
themes are then added in a row with the 'alternate' attribute set. So that all
themes available in the program are always advertized to the browser.

The goody is that users can quickly change the theme if they feel a need to do
so right in the heat of the moment. It wont permanently modify their setting.
Its perfect to just try themes at any place in the application or to do
something specific with a different theme... the page doesn't reload (in
firefox), so one can even change the theme in the middle of filling a form...
very flexible.

As far as I've seen unaware browsers just ignore the 'alternate' lines, so
there's no harm.

stephan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux