[ic] Adding a category header to results page

Marty Tennison interchange-users@interchange.redhat.com
Fri Mar 15 11:01:01 2002


> Here is my problem:  I am trying to set up my results.html 
> page so that it
> can identify what the category is and produce a unique 
> header according to
> that category.  I found some code in one of the back 
> postings that seems to
> work...
> 
> [if explicit]
> [condition]
> $category = '[item-field category]';
> return 1 if $category eq Accent;
> return 0;
> [/condition]
> Accent page header
> [else]
> Not Accent page
> [/else]
> [/if]
> 
> (Although I understand I may have some problems putting in 
> multiple else
> statements....but for another time)
> 
> My problem is I have to put this statement within the 
> [search-list] tags for
> it to correctly read the [item-field category] and when inside the
> [search-list] it ends up repeating with each product 
> listing on the page
> instead of just showing once as a header at the top.  
> Please help me, I know
> I'm missing the obvious answer here.  How else can I read 
> the category
> listing for the page??????

You definetly want to use the [item-change] tag.  Here is an example.

[search-region]
  [search-list]
    [item-change 99][condition][item-field category][/condition]
      [data table="cat" column="name" key="[item-field category]"] 
    [/item-change 99]
  Put some code here
  [/search-list]
[/search-region] 

Hope that helps