[thelist] Multiple but different skins with the same coding?

Hugh Miller hmiller at cfpress.co.uk
Mon Dec 8 07:15:53 CST 2008


Stefan,

I have a similar thing set up for a regional newspaper firm, there is a 
single, 100% the same set of PHP scripts that are used throughout the 
system even though different sites may have slightly different layout, 
components etc.

I use a combination of .htaccess files, mysql backend, php front end to 
do this.

MYSQL basic config:
There is a table "sites" which actually contains anything specific to a 
site. The key one is using a Site Abbreviation code which can then be 
used throughout to change logos etc (ie. siteabb_logo.jpg).

This Site Abbreviation is also used as a column name in the "sections" 
table of which I made a short post to the list about a week and a half 
ago. This table allows for multiple depth of sections, sort ordering 
within sections etc.

The CSS file is simply a PHP script that an .htaccess file tells the 
server to parse. In the "sites" table there is a column for 'skin' (I 
use basic colour names). So http://www.site.com/css/blue/default.css 
maps to http://www.site.com/css/default.php?skin=blue

Within the PHP / CSS file the word blue then loads variables for 
different colour presets that are determined. This is not always 
efficient as sometimes a skin may not use as many alternate colours as 
others so you end up loading unneccesary classes (only adds a few k to 
the file overall though).

The PHP scripts work on a modular principle and all modules are stored 
as functions, called when required, each standard position will 
generally have a fall back default with alternates offered to sites 
(using that site abbreviation code again) where needed.

I'd be happy to go into more detail if required.

H

Stefan Schwarzer wrote:
> Hi there,
>
> we're managing a (data) portal. Now, a wish from partner organizations  
> came up to have "regional" versions of this portal. In a first step we  
> proposed to run all regional versions through the "global" one. This  
> avoids duplication of the code and then further down the line the  
> challenges with upgrading the code to a newer version.
>
> This means that we would have one single portal with different skins,  
> including different logos, titles, eventually even languages.
>
> What is the best way to implement this? Normally, skins are changed by  
> using different CSS styles. But this isn't enough for our project.  
> Especially the home page will be structured slightly differently. The  
> rest of the pages probably will stay the same, except logos etc.
>
> Can someone give me a hint how to achieve this efficiently?
>
> Thanks a lot!
>
>
>   ____________________________________________________________________
>
>    Stefan Schwarzer
>
>    Lean Back and Relax - Enjoy some Nature Photography
>    http://photoblog.la-famille-schwarzer.de
>
>    Appetite for Global Data? UNEP GEO Data Portal:
>    http://geodata.grid.unep.ch
>    ____________________________________________________________________
>
>
>
>
>
>
>   

-- 
Hugh Miller
Web Developer
Clyde & Forth Press Ltd

Tel:   +44-01475-726511
Fax:   +44-01475-783734
Email: hmiller at cfpress.co.uk


This e-mail and any attachments are confidential and intended solely for the addressee. If you have received it in error, please inform the sender and delete it immediately. The views or opinions contained within this email may not be those of Clyde & Forth Press Ltd, which accepts no liability for any damage caused by the transmission of any viruses. E-mail traffic is monitored within Clyde & Forth Press Ltd and messages may be viewed.

Clyde & Forth Press Ltd is a company registered in Scotland (SC132609) with its registered office at Pitreavie Business Park, Dunfermline, Fife, KY11 8QS.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the thelist mailing list