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

MultiLanguage DreamWeaver Themes

 
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  
Author Message
Hani
Smarty n00b


Joined: 04 Jun 2003
Posts: 4

PostPosted: Wed Jun 04, 2003 10:08 pm    Post subject: MultiLanguage DreamWeaver Themes Reply with quote

Hello everyone I have just discovered Smarty and have found it great.
I have written a class that extends it and would like your feedback.
Especifically with regards to the approach I have taken. Have I
reinvented the wheel? Is there a more efficient approach? etc...

The class needs some explaining.

I was looking for a way to provide support for multi languages as well
as multi themes, allowing for these to be changed dynamically by the user.

Luckly I found Smarty and I loved the way Andre provides multilanguage
support (http://www.phpinsider.com/smarty-forum/viewtopic.php?t=84). So with
regards to language I just ripped his code and changed it to suit me better.

As for themes, that is where I had some problems. The approach I saw around
was basically done by adding a {include ... header} and {include ... footer}
to your files, where the actual header/footer file that is included would depend
on a user modifiable variable.

This is fine and works, it has the advantage of being very simple.

But what I wanted was to allow the designers to write the pages in such a way
that they can actually see the headers and footers. DreamWeaver Templates are
great at that.

So what I did was to write a class that extends Smarty and registers a prefilter
that provides support for DreamWeaver.

The way it works is as follows:
- The designer creates a set of DreamWeaverTemplates for his site (lets
assume his website has two types of pages (call them Simple_Main.dwt
(for his Main pages) and Simple_Other.dtw (for his other pages) ).
- He will also creates a number of DreamWeaver Editable regions for these
template files.
- He then creates his webpages using DreamWeaver attaching the appropriate
template to these files.
- At this point he has created what I call a Theme.
- To create a new Theme all he needs to do is create another set of
template files such as Graphical_Main.dwt and Graphical_Other.dwt

What my class allows the users to do is to switch between these various
Themes dynamically.
Additionally I use Smarty to cache these so I dont have to calculate them
all the time, which would cost too much in terms of processing.

The advantage of this approach, is that I when I am editing my pages using
DreamWeaver I actually see the page as it would be displayed (minus smarty
template handling stuff ofcourse).

Having just read what I wrote I think that I may confuse more than explain.

Anyway I have place a copy of my files at
http://www.naguib.info/Smarty

I would appreciate any feedback. I am very new to PhP and have only been playing
around with Smarty for 2 days so I have also added comments in my code where I
think I NEED HELP, any help will be appreciated.

Note that for these to work you will need to modify
a few thingd specially my references to $_SESSION["KApp"] and the includes.
Back to top
View user's profile Send private message Send e-mail
maw
Smarty Rookie


Joined: 18 Apr 2003
Posts: 8
Location: Wellington, New Zealand

PostPosted: Wed Jul 16, 2003 5:11 am    Post subject: DW templates and smarty Reply with quote

Cool I am also working with DW and Smarty and am going to spend some time looking over your code. My goals are different - I am not looking to deal with multi-laguages or selectable themes, however I do want to work with DW templates so that the designer I am working with can see how the compiled page will look in DW.
Back to top
View user's profile Send private message
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