Re: [SMARTY] Re: passing an array to an included template

From: Date: Sat, 04 May 2002 21:46:57 +0000
Subject: Re: [SMARTY] Re: passing an array to an included template
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4054@lists.php.net to get a copy of this message
I thank you all for your hints. I actually should get the content out of my templates to use the strengths of Smarty in the right way. (just for displaying content) The question how to do this is mainly a translation problem. I can assign the content within the PHP-File or I may use a Config-File for each template. There are actually some more complex possibilies to solve the translation problem, so I will have to make up my mind about this. I'm not writing a CMS, so I think I just need a relatively simple solution. Jens PS: Bye the way klipfarm.com looks great Mark. :-) > I've had to tackle the same problem you're trying to solve (check out > www.klipfarm.com & www.serence.com, if interested). In addition to > specifying elements of a navigation I had to allow my template designers > to specify which element was rendered as 'selected' for each page. > > I also only use 1 .php page to render the entire site, distributing > business logic to 'action bundles'. > > My solution was to create a {topnav} plugin which would look something > like this: > > {topnav config_file=#topnav_file# selected=#topnav_selected#} > > config file would point to a text file which looked something like this: > > home = home > products = products_home > solutions = solutions_home > klipfarm = http://www.klipfarm.com > > ...where left hand side was the base image name to be rendered (based on > our own internal naming convention, eg home.gif, home_over.gif, > home_selected.gif), and the right hand side is the target href (again, > based on an internal convention) > > My CMS allows template designers to define pages through Smarty config > files where each section represents a page. Among other properties, > they can specify a 'topnav_file' & 'topnav_selected' config parameter > for each page, if needed. (topnav_file is usually set as a global > parameter -- quite handy) > > As a result, they never need to touch the topnav tag, and if they want > to add or remove topnav links, the plugin takes care of rendering it > properly, adding javascript over states, etc. All they need to do is > tell it the name of the link and where it goes to. They seem to find > the system quite intuitive. > > At any rate, I think your solution probably lies somewhere between > creating a custom plugin and figuring out where to assign information. > > I can provide more detailed examples, if you like. > > -mark > > >

« previous php.smarty.general (#4054) next »