[Typo3-dev] [Typo3] New Extension: CSS Stylesheet Switcher

Ingo Schommer lists at chillu.com
Sun Aug 29 19:55:13 CEST 2004


Hi there!

I always groaned on the possibilities of including CSS-files into Typo3, 
and so I developed a CSS Stylesheet Switcher-Extension (Key: 
is_styleswitcher). Basically, it is just a slightly modified version of 
the GPLed "PHP Stylesheet Switcher" by Rob Ballou 
(http://contrastsweb.com/switcher/).

Which means: No more tedious Typoscript-Header-Output, easy integration 
of accessibility-features such as font-sizing, predefined output-templates.

Features:
- Fast switching via javascript (no page-reload)
- Cookie-functionality (save style-preferences for later browsing-sessions)
- Include css-files as content-elements
- Per-Page-Styles (include only on on certain pages)
- Default-Styles
- Basic-Styles (always included, not selectable by the user)
- Template-driven (set surrounding code, IDs, etc)
- Compatible to browser-integrated style-listings (Opera, Mozilla, ...)


To-Do:
- More Templates (at the moment only <ul>-list is available for output, 
dropdown and radio-buttons are planned)
- Translation (only English/German-Translation at the moment. somebody?)
- Style-Order (place default/selected-style on top-position)
- Groups (allow coherent styles that are only activated together, more 
info on contrastsweb.com/switcher).
- Typoscript-Functionality for more dynamic inclusion-scenarios.
- Documentation (would somebody please tell me how to contribute 
something to the documentations on typo3.org? *g*)
- cached output

Caution:
- Don't mix with manually integrated CSS-files (via Template or 
Typoscript) as they will be not recognized by the extension and will be 
always integrated. If they are included after the extension-code, they 
might override the css-styles set by the "CSS Stylesheet Switcher".
- Try to avoid using the inline-css created by Extensions. Put these 
into external files and override the extension-css by setting 
plugin.tx_<extensionkey>._CSS_DEFAULT_STYLE =
Include these external files in the Switcher-Extension.

Usage:
1. Download&Install
2. (Global styles:) <rootpage>->New->Page Styles
    (Per-Page styles:) <somepage>->New->Page Styles
3. CSS-File-Path is absolute to root, e.g. "/fileadmin/template/screen.css")


For more information on Stylesheet-Switchers:
"A List Apart: Working with Alternative Stylesheets"
(http://www.alistapart.com/articles/alternate/)

Thanks to Rob Ballou for creating this wonderfully modularized 
PHP-Class, which basically does all the dirty work.

Greets
Ingo Schommer

P.S.: Please forgive me crossposting this in typo3.dev, I thought it 
would be interesting for both groups.




More information about the TYPO3-dev mailing list