PHP Themes

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

PHP Themes

Post by Deemo »

In an attempt to not resurrect an old thread, I have created my own topic. The old topic can be access here

I am creating a PHP Framework that does not work like the typical framework. This one provides a "workspace", where functionality is decided through plugins. Having themes and multiple languages is a huge pare of this project, I want creation of themes to be easy, and to be installed very easily.

My question is, what is the best way to have themes? my current idea is that each plugin has a lang directory which stores any custom text that the plugin may use. Each theme also has a lang directory which uses and custom text that the theme uses. I have heard alot about CSS, and how the same code will transform the look of a site, without changing any of the base code. This is intrigueing to me, however I have very little knowledge of CSS. All in all, i have no idea where to start in order to create a system to make themes easy to install, and easy to create.

Any ideas?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

CSS is a VERY easy system to get to grips with, however as it is still a new (ish..) technology, cross platform problems are rife, mind you... same can be said for JavaScript.

Anyhow..

CSS is all based upon the properties of a given object in/on your XHTML page, being seperated from the XHTML. (further separation occurs with the use of external stylesheets)

Code: Select all

<div class="mydiv">Content</div>
pretty simplistic for the XHTML, easy to read and with CSS very easily customised.

Code: Select all

div .mydiv {
    left: 100px; //move 100px from the left
    top: 100px; //move 100px from top
    border: 0; //no border..

//etc..

}
CSS is a very powerful tool, have a look at CSS Zend garden for some simply awesome examples of how much can be done with it.

Also see http://www.w3schools.com for reference and tutorials.
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

Post by Deemo »

do you recommened CSS for the use of a theming engine?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Deemo wrote:do you recommened CSS for the use of a theming engine?
Depends on how elaborate you want your theming capabilities to be. A well designed layout can take many different shapes and sizes, but some things cannot be changed by changing the style attributes. As mentioned before, see Zend Guarden.

Instead, you can offer a selection of template files, which would then be interpreted by a templating engine to display the same content throughout multiple different themes. These very forums take this approach..
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

Post by Deemo »

I think i like the second example more. How exactly would that work? can you provide maybe a link for me to read about?
Post Reply