[ic] [include] in [list]

Mike Heins interchange-users@lists.akopia.com
Fri Jun 29 15:12:00 2001


Quoting bill@worldwideimpact.com (bill@worldwideimpact.com):
> How do I do something like this:
> [query
>         interpolate=0
>         table=prices
>         list=1
>         more=1
>         ml=10
>         st=sql
>         sql=|__SQL_SELECT_ITEMS__| 
> ] 
> [list]
>         [sql-alternate 2]
>                 DO SOME STUFF
>         [else]
>                 DO SOME OTHER STUFF
>         [/else]
>         [/sql-alternate]
>         [include ../htdocs/ic/featured_item.html]
> 
> [/list]
> [/query]
> 
> featured_item.html contains stuff like this:
> [sql-param itemid] [sql-param title]...
> 
> I want to use the stuff in the file featured_item.html on other pages in 
> the site. If I set interpolate=1 in the query tag the include works but 
> the sql-alternate does not.

It should work as is without the interpolate. But it is unwise in several
respects. First of all, it is a major security breach to [include]
stuff from htdocs.

Second, it reads the file for every item; and why would you have ITL tags
in an htdocs file? If you are just going to blat the file out, use [file ...]
and not [include].

Basically, without knowing the contents of your [include ...] file no one
can help. If there are no ITL tags in it, you want to use [file ...]. If there
are ITL tags in it, *not including [sql-*] tags*, it should work, but
you should move it out of htdocs. 

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Few blame themselves until they have exhausted all other possibilities.
 -- anonymous