Page 1 of 1

how to apply themes

Posted: Mon Sep 12, 2005 2:26 am
by eshban
hi,

i want to implement themes in my project. means i have different themes in a themes folder. The admin has rights to change and apply a new theme. i want that there is a list which shows all themes. when admin apply theme 1, then the header, footer and css of the complete site is change according to theme 1 .

how can i implement this. what is the logic behind this.

Posted: Mon Sep 12, 2005 2:32 am
by feyd
Read up on template engines. We've talked about them ad nauseum here.

Smarty

Posted: Mon Sep 12, 2005 2:48 am
by eshban
i don't want to use templates. just want to done through simple code

Posted: Mon Sep 12, 2005 2:56 am
by feyd
then you'll need to write code that can 1) retrieve the "active" theme to accurately pull the header/footer/css files 2) allow for scripted fetching of each of those files.

Both are not difficult, typically. The first is a simple database query. The second is often a matter of using the correct path (using the results of the database query) to build the proper path to find the files in.