Re: [htmltmpl] how to determine if tmpl_var exists in a loop?
Brought to you by:
samtregar
From: Puneet K. <pk...@ei...> - 2004-04-17 19:01:35
|
On Apr 17, 2004, at 1:37 PM, Clifton Royston wrote: > On Sat, Apr 17, 2004 at 11:44:45AM -0500, Puneet Kishor wrote: >> On Apr 17, 2004, at 11:25 AM, Karen J. Cravens wrote: >>> On Sat, 17 Apr 2004, Puneet Kishor wrote: >>> >>> PK>What is/are a typical circumstance(s) where I would not already >>> know >>> PK>what vars exist in a template and would want to use query to find >>> out? >>> >>> It's the split between template and programming thing. I've >>> considered >> >> On Apr 17, 2004, at 11:18 AM, Roger Burton West wrote: >> >>> On Sat, Apr 17, 2004 at 11:10:35AM -0500, Puneet Kishor wrote: >>> >>>> What is/are a typical circumstance(s) where I would not already know >>>> what vars exist in a template and would want to use query to find >>>> out? >>> >>> The most obvious case is the one in which someone else is being given >>> the HTML design part of the job. >> >> Interesting. I have approached this always with the attitude that I >> have to separate programming from display as much as possible. I've >> just finished a relatively complicated app -- a single cgi script >> about >> 2000 lines long, and about 45 different templates. My approach has >> been >> to create the templates in such a way that they could exist as a >> standalone website even if there was no H-T involved. In other words, >> if a designer-type decided to load the entire templates folder with >> its >> stylesheets and javascripts and whatnot in a designer-type program >> (GoLive or Dreamweaver, etc.), a complete, well-formed website would >> manifest, of course, with tmpl_vars intact. It may look a bit kooky >> since tables won't be fleshed out, and a few unavoidable tmpl_ifs >> won't >> be logic-ed out, but nonetheless -- it would be a website with all its >> links and scripts and behaviors and whatnot. > > That's exactly the approach I decided we should take for designing > our GUI. In fact, the final form of most of the templates was created > in Dreamweaver. > > On a similar principle, I made the various CGI scripts for displaying > the templates load the template with the name exactly corresponding to > the URL it's invoked under. That sounds a little confusing to say, but > it just means that if you go to an URL like /admin/home/news.html, the > CGI will pick up that URL and open and render a template from the path > .../templates/home/news.html. > > Clifton, That is really cool. Could you (here, or offline) share more about how you did this? In effect, the users are not going to index.cgi?do=somecrap, but they are going to /website/somecrap. So you can use path_info, but how are you getting the cgi to fire up? I know this can be accomplished somewhat with the help of mod_rewrite, but that is not always possible. I am very interested in knowing how you are accomplishing this. Thanks. |