[ic] Loop Search Question
jon at endpoint.com
Thu Jul 17 00:12:34 UTC 2008
On Wed, 16 Jul 2008, William Fiore wrote:
> I have the following component that displays the latest 3 items added to
> the store. I want to limit the results to products that do not have an
> image name of "default.gif" (products with a image named default.gif are
> usually so new that they are missing not only images, but descriptions
> and pricing as well).
> [loop search="fi=products/st=db/co=1/sf=date_added/op=le/nu=0/ml=3/tf=date_added/to=r"]
> <p><a href="[area [loop-code]]">[loop-field title]</a> - <br><span
> class="content_left_top_bold">[loop-code] ([convert-date
> format="%m-%d-%Y"][loop-field date_added][/convert-date])</span></p>
I find that this is where SQL shines and Interchange's built-in search is
a burden. I'd rewrite it as SQL so it's easier to add whatever clauses you
want. Something like this should work:
SELECT code, title, date_added
WHERE image <> 'default.gif'
ORDER BY date_added DESC
<p><a href="[area [loop-code]]">[loop-field title]</a> etc. etc.
End Point Corporation
More information about the interchange-users