[ic] include-like tag that parses before loop tags?

Doug Alcorn doug at lathi.net
Thu Oct 16 15:06:50 EDT 2003

"Grant" <listbox at email.com> writes:

> Is there a tag that functions similarly to [include] that is parsed
> before loop tags?  This would enable loop tags in the include file
> to be parsed after the file is "included".

I ran into this recently.  I have a very complicated page with lots of
loops in it.  To make the page easier to read and edit, I broke it
down into multiple pages using [include].  What I ended up doing was
putting the entire loop into the included file.  

The only way to "pass parameters" to the included file to control the
loop is through global scratch variables (at least afaik).  In my
case, the complicated page is a flypage and my loops are really sql
[query] tags.  So, I just [seti item_code][item-code][/seti] on the
flypage and then used [query sql="select .... from .... where
code='[scratch item_code]'...."].

Yes, this method is a little expensive with the extra lookups.  It's
not too bad though.  My tables aren't too big and good where clauses
make it fast.  Of course, IC does quite a few queries own for each
page.  I figure one or two more extras isn't too bad to gain code
 (__) Doug Alcorn - Unix/Linux/Web Developing
 oo / PGP 02B3 1E26 BCF2 9AAF 93F1  61D7 450C B264 3E63 D543
 |_/  mailto:doug at lathi.net http://www.lathi.net
      mailto:tarpit at lathi.net is a spam trap

More information about the interchange-users mailing list