Thursday 08 December 2005 3:27:35 am
Hi Lukasz! I've still not solved this problem..your example worked (so tnx 2 u), but I can't still complete my task with the grouping of the searchresult with ezsearch. Displayed through this code is only the first section with website, chapters and links viewable. The articles of class 2 are not beeing listed. Do you know why? Is it possible to use $SearchResult only once in a loop?
{section show=$search_text}
{switch name=Sw match=$search_count}
{case match=0}
<h2>No results for: "{$search_text|wash}"</h2>
{/case}
{case}
<h2>{$search_count} hits for {$search_text|wash}</h2>
{/case}
{/switch}
{* start list results for website,chapters and links *}
{let class_ids=array(25, 21, 6)}
<table class="list" width="100%" border="0" cellspacing="0" cellpadding="0">
{section name=SearchResult loop=$search_result show=$search_result sequence=array(bglight,bgdark)}
{section show=$class_ids|contains($SearchResult:item.object.contentclass_id)}
{run-once}
<tr><td><h2>Mixed content</h2></td></tr>
{/run-once}
<tr>
<td class="{$SearchResult:sequence}"><a href={$SearchResult:item.url_alias|ezurl}">{$SearchResult:item.name|wash}</a>
</td>
</tr>
{/section}
{/section}
</table>
{/let}
{* end list results for website,chapters and links *}
{* start list results for articles *}
{let class_idsa=array(2)}
<table class="list" width="100%" border="0" cellspacing="0" cellpadding="0">
{section name=SearchResult loop=$search_result show=$search_result sequence=array(bglight,bgdark)}
{section show=$class_idsa|contains($SearchResult:item.object.contentclass_id)}
{run-once}
<tr><td><h2>Articles</h2></td></tr>
{/run-once}
<tr>
<td class="{$SearchResult:sequence}"><a href={$SearchResult:item.url_alias|ezurl}">{$SearchResult:item.name|wash}</a>
</td>
</tr>
{/section}
{/section}
</table>
{/let}
{* end list results for articles *}
{/section}
..as I told you earlier, I want to list:
"topic"
list websites, chapters, links (list only 10 items of these classes at the first page)
and under here:
"topic" list articles (list only 10 items of this class at the first page).. The point is to group the searchresults, and not list everything in just a mix. Hope someone can help me out with this :(
|