|
PHP Enabled Stylesheets
Bertrand Potier
Introduction
CSS Stylesheets are a major improvement in the World Wide Web, allowing HTML
to come back to its roots: a language to structure and publish content on the
web, not to apply a visual formatting to that content. Unfortunately HTML and
CSS have the same limitations: both are static languages!
From Perl scripts to PHP, a lot of technologies are today available to move HTML to the dynamic
age but why not, going even further and do the same with CSS? That's what I did
when developing eDContainer (a container for web sites and web applications),
having the following objectives in mind:
- To provide an external, user-friendly, visual configuration file: the user doesn't have to edit the stylesheet, he may not be familiar with CSS and even if so, properly editing a stylesheet requires some experience.
- To not have to repeat general identical values like fonts and colors x times within the stylesheet: the value is defined once in the visual configuration file and inserted automatically by PHP in the different locations within the stylesheet.
- To provide a solution to the implementation of skins or themes (similar to Winamp or Windows XP principles): several different visual configurations can be defined and dynamically switching from one to the other is possible.
- To be able to change some style behaviors dynamically, depending on some configuration values.
If you're quite familiar with PHP and CSS, reading the above objectives will
probably make you already think about some solutions to achieve them. That's the
fun about coding, always different and sometimes better ways to obtain the same
results! When writing this article, I'm not saying that what is described here
is the only way to do it. It's a way and I hope I'll manage to keep you
interested: Let's start!
[ Next Page ]
| Comments: | ||
| Broken links | Dave N. | 10/04/05 08:26 |
| RE: php interfaces & classes | Edson Luk | 04/22/05 14:30 |
| how to start creationg CSS in PHP | Pattan | 11/18/04 07:16 |
| RE: Caution! | Kaare | 05/22/04 15:19 |
| RE: How is this better than... | Jesus A. Domingo | 12/28/02 14:04 |
| RE: Template: Separate Design from Contents | Bertrand Potier | 12/28/02 09:57 |
| RE: Caution! | Jetboy | 12/21/02 14:18 |
| RE: Caution! | Jason | 12/19/02 09:42 |
| MIME Type | g_a_t_e | 12/18/02 07:18 |
| <STYLE> Tag | Brad | 12/17/02 23:12 |
| Template: Separate Design from Contents | Jean-Marc Molina [goa103] | 12/14/02 20:59 |
| Caution! | Jetboy | 12/14/02 16:49 |
| Very interesting | Tristan Crickett | 12/09/02 14:39 |
| RE: How is this better than... | Timothy Western | 12/04/02 08:44 |
| RE: How is this better than... | Bertrand Potier | 12/04/02 01:59 |
| RE: How is this better than... | CrazyToon | 12/03/02 19:15 |
| RE: How is this better than... | Eric | 12/02/02 21:09 |
| How is this better than... | Ross Bemrose | 11/28/02 07:48 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


