[ic] database lookup tag

Mike Heins interchange-users@interchange.redhat.com
Thu Feb 14 12:39:01 2002


Quoting Honest to Goodness (h2g@sympatico.ca):
> When a user clicks on one of the categories in my modified foundation
> store, the results page comes up and at the top I want to display a
> little paragraph about that category. So I added an extra field to the
> cat table and put my text in there. But to retreive it I've tried using
> the data tag like this:
> 
> [data base="cat" field="biograph" code="00109"]
> 
> This works except the hard coded lookup code returns the same biograph
> for every category. It would be nice if I could reference the cat table
> with another column like:
> 
> [data base="cat" field="biograph" name="[item-field category]"]
> 
> but this doesn't work. This part of the results page is iterating
> through products and the products table only contains the name of the
> category not the code and I don't want to add another field to products.
> 
> So is there some other tag I can use that will fetch my category field?

Same tag, different usage:

[data table=cat column=biograph key="[item-field category]" foreign=name]

Not very fast, though. Will be faster if you are indexed on "name".

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

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown