2

I am using supersearch module, here is link for doc of its http://www.solspace.com/docs/super_search. Actually I am facing a problem that is to get records group by.

Using this module i dont know how to get the entries group by channel. I want the entries result group by its channel.

This is my code: Search :

<form method="post" action="{path='search/results'}/" style="padding-top: 15px;">
    {exp:super_search:search} 

    <input type="text" name="title" value="" style="height: 31px;"/>
    <input type="submit" value="Search" />

    {/exp:super_search:search}
</form>

Result :

{exp:super_search:results paginate="both" limit="10"}

{channel_name}<br/>
{title} <br/>

{paginate}<p>Page {current_page} of {total_pages} pages {pagination_links}</p>{/paginate} 
{/exp:super_search:results}

there are 5 channel in my project and each channel having at least 15 records. I want all record group by channel.

Can anybody tell how can I get the records what I exactly wants.

Sorry for my bad English Thanks.

And Yes I want the Records like below mention : [if possible please suggest for the same]

Channel -1 --entry-1 --entry-2 --entry-3 --entry-4

Channel -2 --entry-1 --entry-2 --entry-3

Channel -3 --entry-1 --entry-2 --entry-3

Continuous like this..

1

In your Results loop you could add:

orderby="channel_name"

You would then want to store the last items channel_name and compare it to the current items channel_name to find when you wanted to actually output the channel_name to the screen.

| improve this answer | |
  • Hello Scott, thanks for reply.. As you mentioned I got the result with "orderby.." but that will being more helpful to me if can tell me how to store the last items channel name and how to compare it to current item channel name.. Yes, I don't know how to do exactly this, as I am new to EE.. Thanks a lot.. it'll be great if you can give me solution and code for the same.. – jt. Aug 23 '13 at 5:54
0

I didn't have a chance to test this, and make sure you have php enabled on your template, but try something like what is below:

<?php $prev_channel = ""; ?>

{exp:super_search:results orderby="channel_name" paginate="both" limit="10"}

{if channel_name != "<?php echo $prev_name?>"}
    {channel_name}<br/>
{/if}
{title} <br/>
{paginate}<p>Page {current_page} of {total_pages} pages {pagination_links}</p>{/paginate}
<?php $prev_name = {channel_name}; ?>

{/exp:super_search:results}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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