0

I am getting multiple results of same data.please suggest

Search Page Code

{exp:search:simple_form channels="pages|news" result_page="widgets/Widget_search_results/" search_in="everywhere" form_class="search" where="all" show_expired="yes" show_future_entries="yes"}    
  <input type="text" maxlength="100" size="18" value="" id="keywords" name="keywords">
  <input type="submit" class="submit" value="search">        
 {/exp:search:simple_form}

Result Page code

{exp:channel:entries {embed:_channel_params}}
<!-- Start Widget: {channel_short_name} -->
<table border="0" cellpadding="6" cellspacing="1" width="100%">
<tr>
<th>{lang:title}</th>
<th>{lang:excerpt}</th>
<th>{lang:author}</th>
<th>{lang:date}</th>
<th>{lang:total_comments}</th>
<th>{lang:recent_comments}</th>
</tr>

{exp:search:search_results switch="resultRowOne"}

<tr class="{switch}">
<td width="30%" valign="top"><b><a href="{auto_path}">{title}</a></b></td>
<td width="30%" valign="top">{excerpt}</td>
<td width="10%" valign="top"><a href="{member_path='member/index'}">{author}</a></td>
<td width="10%" valign="top">{entry_date format="%m/%d/%y"}</td>
<td width="10%" valign="top">{comment_total}</td>
<td width="10%" valign="top">{recent_comment_date format="%m/%d/%y"}</td>
</tr>

{/exp:search:search_results}

</table>
<!-- End Widget: {channel_short_name} -->
{/exp:channel:entries}

1 Answer 1

2

Not sure why there are channel:entries loops in this template - I'm assuming you've inherited this site from another developer?

Start by removing the opening and closing channel:entries tags.

2
  • YEs i copied this code..what would be the correct syntax without Loop??
    – user2576
    Commented Jan 7, 2014 at 15:32
  • In this case, it appears you shouldn't even need the exp:channel:entries loop. Just delete the starting and ending tags and you should be okay, probably. Commented Jan 7, 2014 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.