Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Multi themes with Smarty

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  

Have you ever worked with multi themes or are now thinking of it?
Yes. Thanks for the idea.
100%
 100%  [ 2 ]
No. I feel, it is difficult.
0%
 0%  [ 0 ]
Total Votes : 2

Author Message
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 423

PostPosted: Mon Jan 19, 2009 5:54 pm    Post subject: Multi themes with Smarty Reply with quote

I have a very strong sight that we can create multi themes with Smarty in a much better way. Because of the time limits out of my jobs, I have not really done a multi theme work with Smarty.

But here is what I see:

Each unique template directory should be called a theme.
You can program to customize the user's default template directory.
Use database to store per user's default theme.
When the user logs in, use his/her default theme, by loading its name in the database.
Use $_SESSION or cookie variable to hold the theme name through out the users login session.

Remember,
You need to have multiple templates with propler variable formatting, looping into the each template files.
Sometimes, using a different css file can create a different theme and layout.

Finally, use tricks whenever possible.


Last edited by bimal on Tue Jan 20, 2009 5:33 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
mitchenall
Smarty Pro


Joined: 27 Feb 2004
Posts: 107
Location: London, UK

PostPosted: Tue Jan 20, 2009 2:16 am    Post subject: Re: Multi themes with Smarty Reply with quote

This has little to do with smarty itself. And as a poll, this is a useless question with useless answers.

Have I used Smarty for multi-themed sites? Yes.

Does the rest of your post make any sense in the real world? No

More importantly, the stuff you mention in the post has nothing to do with smarty, and only how it is implemented.
_________________
Mark Mitchenall
Back to top
View user's profile Send private message Visit poster's website
bimal
Smarty Elite


Joined: 19 Apr 2007
Posts: 423

PostPosted: Tue Jan 20, 2009 5:03 pm    Post subject: producing multiple themes Reply with quote

You are right.

This post describes one way to implement Smarty in multi themes. It is a description to my un-worked concept only (may be many developers have already done it). Confidently, we can produce multiple themes, if we write them with Smarty. If the themes we are are of traditional types, Smarty has nothing to do. And in many cases, Smarty has no genuine control over our application's logic.

I am taking about session variable just to remember, what theme has a user has selected in his configuration. This can be simply a smarty template directory name.

To complete this concept, we need to produce multiple themes as well. So, we will need to know, how many unique smarty templates are available to use, so that a user can choose one among our list.


Last edited by bimal on Tue Jan 20, 2009 5:23 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Jan 20, 2009 5:13 pm    Post subject: Reply with quote

There are lots of existing threads on this.

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=7310
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP