[ic] [include] in [list]

interchange-users@lists.akopia.com interchange-users@lists.akopia.com
Fri Jun 29 15:28:00 2001


I need to use the same basic html on two different pages. My goal is to 
not have to maintain two copies of it.

Here is the contents of the file I want to include. Or better said the 
piece of html I want to use in multiple places but only want to maintain 
one copy of:

        <!-- Tabs. More Like This and Category -->
        <table border="0" cellpadding="0" cellspacing="0" width="291">
                <tr height="22">
                        <td width="28" height="22"><img 
src="/images/shim.gif" width="28" height="1" border="0"></td>
                        <td width="16" height="22"><img 
src="/images/content/features/tab_lft_lft.gif" width="16" height="22" 
border="0"></td>
                        <td 
background="/images/content/features/tab_blu_slice.gif" class="text1" 
align="right" width="85" height="22">
                                <a href="[area
                                                        href=results
                                                        form=|
 catid=[sql-param catid]
                                                                |
                                                ]">more like 
this&gt;&gt;</a>
                        </td>
                        <td width="15" height="22"><img 
src="/images/content/features/tab_lft_mid.gif" width="15" height="22" 
border="0"></td>
                        <td 
background="/images/content/features/tab_tan_slice.gif" align="center" 
width="110" class="category" height="22">
                                [sql-param category]
                        </td>
                        <td width="16" height="22"><img 
src="/images/content/features/tab_lft_rght.gif" width="16" height="22" 
border="0"></td>
                        <td width="21" height="22"><img 
src="/images/shim.gif" width="21" height="22" border="0"></td>
                </tr>
        </table>
                <!-- Brand and Title -->
        <table border="0" cellpadding="0" cellspacing="0" width="291">
                <tr height="43">
                        <td width="2" height="43"><img 
src="/images/shim.gif" width="2" height="1" border="0"></td>
                        <td width="16" height="43"><img 
src="/images/content/features/header_lt.gif" width="16" height="43" 
border="0"></td>
                        <td 
background="/images/content/features/header_slc.gif" width="258" 
align="right" height="43">
                                <span class="brand">[sql-param 
brand]</span>
                                <br>
                                <span class="title">[sql-param 
title]</span>
                        </td>
                        <td width="15" height="43"><img 
src="/images/content/features/header_rt.gif" width="15" height="43" 
border="0"></td>
                </tr>
        </table>
        <table border="0" cellpadding="0" cellspacing="0" width="291">
                <tr height="4">
                        <td width="2" height="4"><img 
src="/images/shim.gif" width="2" height="4" border="0"></td>
                        <td align="right" width="50" height="4"></td>
                        <td width="2" height="4"></td>
                        <td width="4" bgcolor="[scratch colors->grey]" 
height="4"><img src="/images/shim.gif" width="4" height="4" 
border="0"></td>
                        <td bgcolor="[scratch colors->grey]" width="222" 
height="4"><img src="/images/shim.gif" width="1" height="4" 
border="0"></td>
                        <td bgcolor="[scratch colors->grey]" width="4" 
height="4"><img src="/images/shim.gif" width="4" height="4" 
border="0"></td>
                        <td 
background="/images/content/features/side_slc.gif" width="7" 
height="1"><img src="/images/shim.gif" width="7" height="4" 
border="0"></td>
                </tr>
                <!-- Image and Vintage and description -->
                [seti image][image classid=item identity='[sql-param 
itemid]' width=40 num=1][/seti]
                <tr>
                        <td width="2"><img src="/images/shim.gif" 
width="2" height="1" border="0"></td>
                        <td align="right" width="50" valign="top">
                                [scratch image]
                        </td>
                        <td width="2"><img src="/images/shim.gif" 
width="2" height="1" border="0"></td>
                        <td width="4" bgcolor="[scratch 
colors->grey]"><img src="/images/shim.gif" width="4" height="1" 
border="0"></td>
                        <td bgcolor="[scratch colors->grey]" valign="top" 
width="222"class="description">
                                <span class="vintageage">[sql-param 
vintage]</span>
                                <br>
                                [filter text2html][truncate 
num=30][sql-param description][/truncate][/filter]
                                <a href="[area
                                                        href=detail
                                                        form=|
 itemid=[sql-param itemid]
                                                                |
 ]">Details&gt;&gt;</a><br>
                                        <img src="/images/shim.gif" 
width="1" height="6"><br>
                                        <div class=priceRetail 
align=right>
                                                [get_prices 
itemid='[sql-param itemid]']
                                        </div>
                                        <img src="/images/shim.gif" 
width="1" height="6"><br>
                                </td>
                                <td bgcolor="[scratch colors->grey]" 
valign="top" width="4"><img src="/images/shim.gif" width="4" height="1" 
border="0"></td>
                                <td 
background="/images/content/features/side_slc.gif" width="7" 
height="1"><img src="/images/shim.gif" width="7" height="4" 
border="0"></td>
                        </tr>
                </table>
                <!-- itemid -->
                <table border="0" cellpadding="0" cellspacing="0" 
width="291">
                        <tr height="28">
                                <td width="2" height="28"><img 
src="/images/shim.gif" width="2" height="1" border="0"></td>
                                <td width="15" height="28"><img 
src="/images/content/features/footer_lft.gif" width="15" height="28" 
border="0"></td>
                                <td 
background="/images/content/features/footer_slc.gif" width="145" 
height="28" class="itemid">BN#[sql-param itemid]</td>
                                <td 
background="/images/content/features/footer_slc.gif" width="114" 
height="28"><img src="/images/shim.gif" width="5" height="1" 
border="0"></td>
                                <td width="15" height="28"><img 
src="/images/content/features/footer_rt.gif" width="15" height="28" 
border="0"></td>
                        </tr>
                </table>

Bill Carr
Worldwide Impact
bill@worldwideimpact.com
413.253.6700




Mike Heins <mikeh@minivend.com>
Sent by: interchange-users-admin@developer.akopia.com
06/29/2001 03:12 PM
Please respond to interchange-users

 
        To:     interchange-users@developer.akopia.com
        cc: 
        Subject:        Re: [ic] [include] in [list]


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
_______________________________________________
Interchange-users mailing list
Interchange-users@lists.akopia.com
http://lists.akopia.com/mailman/listinfo/interchange-users