Categories:
Author:
Current version:
0.2
About It:
Get it:
Rate it:
Flag it:
fla_style_switcher
fla_style_switcher is a stylesheet switching system. It enables a cookie-based style switcher system, based on Build a PHP Switcher by Chris Clark, published on alistapart.com.
Usage:
Replace the standard call to the css file in the “head” section of your page templates with: <txp:fla_style_switcher />.
You can specify a default stylesheet: <txp:fla_style_switcher default="otherdefault"/>
and specify the media this stylesheet is dedicated to: <txp:fla_style_switcher media="print" />
For stylesheet linking, please see the fla_altstyle_link plugin
Archived [?]: orphaned
Initially released:
04.08.17Posted here:
26 Mar 2005Article modified:
20 Jan 2008









If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:
Commented (7)
The < txp:fla_style_switcher /> is not parsed in the head call :
< link rel="stylesheet" href=" " type="text/css" />
doesn’t work….
Plugin is activated properly, the switcher links are there but doesn’t work with rev392…
“scope” is a unique identifier that defines a page/section of the site for which the given default stylesheet applies.
“days” defines how many days you want the cookie to be valid.
Here is the modified code:
function fla_style_switcher($atts)
{
$html = “”;
if (is_array($atts)) extract($atts);
$style_media = ($media) ? $media : “screen”;
$stylesheet = ($default) ? $default : $stylesheet;
$subdir = ($scope) ? $scope.”_” : “”;
$time = ($days) ? $days : “1”;
if (array_key_exists(“css”, $_GET))
{
$stylesheet = $_GET[‘css’];
}
elseif (array_key_exists($subdir.”txp_stylesheet”, $_COOKIE))
{
$stylesheet = $_COOKIE[$subdir.’txp_stylesheet’];
}
setcookie($subdir.”txp_stylesheet”, $stylesheet, time()+3600*24*$time, ”/”, $_SERVER[‘SERVER_NAME’], “0”);
$html .= “”;
return $html;
}
One question: Why isn’t this and the fla_altstyle_link plugin not one plugin?
Both pugins arent available – does anyone have a copy?
I Can’t download the Plugins, it would be very cool if someone has a copy of them.
Regards SNitch
Both plugins come with the fireplay style theme, as I was wondering exactly the same thing. Just copy the data between the ‘ ‘ characters into the plugin admin on textpattern.
Both plugins come with the fireplay style theme, as I was wondering exactly the same thing. Just copy the data between the ‘ ‘ characters into the plugin admin on textpattern.
Subscribe to this article's comments RSS feed. [ ? ] View Recent Comments across the site. Get a Gravatar.
Would you care to write a comment or visit the forum discussion?