Super Search 3.x

Legacy documentation for Super Search 3.x.

Super_Search:Curated_Results template tag

The Super_Search:Curated_Results tag is part of the Curation feature available in the Super Search control panel. It works similar to the Super_Search:Results tag and displays the channel entry results from a search query from a search form. This feature is designed to allow manual selection of entries for keyword searches, and would typically be used as supplimental search results to normal search results, similar to how Google displays sponsored results at the top or side of search results pages.

{exp:super_search:curated_results} content {/exp:super_search:curated_results}

Parameters

The following parameters are available for use:

channel=

channel="products|locations"

This parameter allows you to filter your results by a channel's short name. You can provide multiple channels separated by pipe and you can negate the whole set like this: channel="not somechannel|anotherchannel".

limit=

limit="50"

This parameter controls how many entries show up on your results page.

orderby=

orderby="title+asc"

This parameter sets the display order of the entries. You can use any of the options available with Channel:Entries. The syntax is to specify an order type and then the sort direction, and should look something like this: title+asc.

paginate=

paginate="both"

Pagination works just like it does in the Channel:Entries tag. When specified, and used in conjunction with the paginate variable pair, pagination will display. Refer to Channel:Entries tag documentation for more information.

site=

site="site_one|site_two"

This parameter allows you to filter down the results by MSM sites. You can specify 1 or more MSM site short names in this parameter. Refer to Multiple Site Manager documentation for more information.

status=

status="not closed|pending"

This parameter allows you to hardcode status(es) for the search query. Separate multiples with the pipe (|) character.

Variables

In addition to most variables available in the Channel:Entries tag, the following variables are available for use inside Super_Search:Curated_Results tag:

Available outside of Super_Search:Curated_Results tag (anywhere on page):

excerpt

{excerpt}

This variable will behave just like it does in the native EE Search module. It will strip HTML and other things. If smart excerpts preference in Super Search control panel is set to Yes (or smart_excerpt parameter is set to yes), Super Search will attempt to find the first occurrence of a search term match within the excerpt field, and start the excerpt snippet at that point (similar behaviour to what you see in search results like Google). This gives the appearance of more relevant results to the user. If no search term matches are found, the excerpt will go back to default behaviour and start at the beginning of the excerpt fields' value. The Curated_Results tag respects the setting in the Super Search control panel by default, but this parameter overrides it. Used inside the Super_Search:Curated_Results tag.

super_search_keywords

{super_search_keywords}

This variable will display the search terms specified in a keyword search (using the keywords form name in a search form, or in the URI). Can be used both inside or outside of the Super_Search:Curated_Results tag.

super_search_total_results

{super_search_total_results}

This variable will output the total number of regular search results for the given search query ONLY if the Super_Search:Results tag is also on the same page. Can be used both inside or outside of the Super_Search:Curated_Results tag.

super_search_total_curated_results

{super_search_total_curated_results}

This variable will output the total number of curated results for the given search query. Used outside of the Super_Search:Curated_Results tag.

super_search_YOUR_CUSTOM_FIELD

{super_search_YOUR_CUSTOM_FIELD}

For each custom field you search on, you can display the value that was searched upon. Just prepend each variable with super_search_. So if you have a custom field named product_description, you'd call that search term in your template as {super_search_product_description}. In the event you're using -exact, -empty, -from, and/or -to types for your field searches, remember to include that in the variable name as well. For example, a range (from/to) search on a field called price would look like this:

Products priced from "{super_search_price-from}" to "{super_search_price-to}"

Used outside the Super_Search:Curated_Results tag.

Variable Pairs

In addition to most variable pairs available in the Channel:Entries tag, the following variable pair is available for use:

paginate

{paginate}
    <li>
        Page {current_page} of
        {total_pages} pages &nbsp;
        {pagination_links}
    </li>
{/paginate}

OR

{paginate}
<ul class="pagination">
    {pagination_links}
        {first_page}
            <li><a href="{pagination_url}">First</a></li>
        {/first_page}
        {previous_page}
            <li><a href="{pagination_url}">&laquo; Previous</a></li>
        {/previous_page}
        {page}
            <li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
        {/page}
        {next_page}
            <li><a href="{pagination_url}">Next &raquo;</a></li>
        {/next_page}
        {last_page}
            <li><a href="{pagination_url}">Last</a></li>
        {/last_page}
    {/pagination_links}
</ul>
{/paginate}

Pagination is available for this tag and works just like regular EE pagination. Used in conjunction with the paginate parameter.

Conditionals

In addition to most conditionals available in the Channel:Entries tag, the following conditionals are available for use:

super_search_no_results

{if super_search_no_results}
    Sorry, no results were found.
{/if}

This conditional displays it's contents when there are no results found.

Examples

Basic Curated Results Page

The following sample code is a basic example of how your Curated Search Results page might look:

<h2>
    {super_search_total_curated_results}
    results for the keyword search:
    "{super_search_keywords}"
</h2>

{exp:super_search:curated_results
    channel="articles"
    paginate="both"
    limit="10"
    orderby="title+asc"
}
    <div class="search_result">
        <h3>{title}</h3>
        <p>Price: ${price}</p>
        <p>{excerpt}</p>
    </div>
    {if super_search_no_results}
        <p>No results matched your query.</p>
    {/if}
    {paginate}
        <p>Page {current_page} of {total_pages} pages. {pagination_links}</p>
    {/paginate}
{/exp:super_search:curated_results}

Basic Combined Results & Curated Results Page

The following sample code is a basic example of how your results page with Curated Results and regular Search Results combined page might look:

<h2>
    {super_search_total_results} results
    (+ {super_search_total_curated_results} curated)
    for the keyword search:
    "{super_search_keywords}"
</h2>

{exp:super_search:curated_results
    channel="articles"
    limit="5"
    orderby="title+asc"
}
    <div class="search_result">
        <h3>{title} (Curated)</h3>
        <p>Price: ${price}</p>
        <p>{excerpt}</p>
    </div>
    {if super_search_no_results}
        <p>No curated results for this search.</p>
    {/if}
{/exp:super_search:curated_results}

{exp:super_search:results
    channel="articles"
    paginate="both"
    limit="10"
}
    <div class="search_result">
        <h3>{title}</h3>
        <p>Price: ${price}</p>
        <p>{excerpt}</p>
    </div>
    {if super_search_no_results}
        <p>No results matched your search query.</p>
    {/if}
    {paginate}
        <p>Page {current_page} of {total_pages} pages. {pagination_links}</p>
    {/paginate}
{/exp:super_search:results}