Super Search 3.x

Legacy documentation for Super Search 3.x.

Super_Search:Results template tag

The Super_Search:Results tag displays the channel entry results from a search query (it only works for searching on channel entries). And since search queries in the URI (and from POST searches) are human-readable (template_group/template/search&keywords=bird&summary=is+the+word), users can bookmark result pages, along with many other benefits. Searches can be performed in a variety of ways:

  • Submitting a standard search form (see Super_Search:Form documentation for more information about constructing a search form)
  • Reading a search query in the URI that was manually linked to from another page, etc.
  • Hardcoding a search query into the Results tag itself.
{exp:super_search:results} content {/exp:super_search:results}

Parameters

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

allow_repeats=

allow_repeats="no"

This parameter allows you to have multiple Super_Search:Results calls in a session and each successive call will exclude previously found entries from it's query so that all entries found in a session are unique. Basically, in the event you're using the Super_Search:Results loop as a full replacement to the Channel:Entries loop, you would typically use this if you were displaying several sets of entries within 1 template, and there being the possibility of a channel entry showing up across all or any of the Results loops. So if Entry B shows up in the first Results loop, even if it technically should also show up in a second or third instance of the Results loop, with this parameter set to no, it will be excluded. Default is yes.

Note: because EE caches duplicate calls to the same tag in a template, its important to make sure there is at least one minor difference in the opening tag loops if you are using this feature. Something as simple as a parameter or even an EE comment like {!-- loop 2 --} will work. Otherwise, this functionality will not work since EE caching will override and just show duplicate results for each loop.

author=

author="jake"

This parameter allows you to filter entries down by a given author. It looks for username by default, unless overridden by the author_indicator parameter. Alternate options are screen name and member ID. Must be exact matches. If you wish to allow partial matches, specify yes in the partial_author parameter. This parameter cannot be overwritten by data sent through POST or URI.

author_indicator=

author_indicator="screen_name"

This parameter allows you to override the default value of username for author searches with the author parameter. To override this, indicate screen_name or member_id in this parameter. If searching on screen names in the URI, make sure the value is wrapped with quotes so screen names with spaces are properly recognized.

category=

category="Teeth"

This parameter allows you to force a category search into the search query. Default behavior is looking for category names. To switch this to category ID or URL titles, use the category_indicator parameter. The contents of this parameter follow the same syntax as regular Super Search queries in the URI or through POST variables. This parameter cannot be overwritten by data sent through POST or URI. For example:

  • category="Teeth" would fetch entries that belonged to the category of Teeth.
  • category="Teeth+Gums" would fetch entries that belonged either to the Teeth category or the Gums category.
  • category="Teeth&&Gums" query would fetch entries that belonged both to the Teeth category and the Gums category inclusively.
  • category="-Teeth" would fetch entries that do NOT belong to the Teeth category.
  • category="-Teeth+-Gums" would fetch entries that do NOT belong to the Teeth category or the Gums category.

category_indicator=

category_indicator="category_url_title"

This parameter allows you to tell Super Search how you will be providing categories in your search strings. The default behavior is to accept category names (category_name) to allow for better user play, but you can have a more reliable search by providing categories by category URL titles (category_url_title) or ID's (category_id).

channel=

channel="products|locations"

This parameter allows you to force a channel search into the search query. This parameter can be overwritten by data sent through POST or URI, but only with channels submitted through POST of the URI that have been provided within the channel parameter. For example, if you have this: channel="products|locations", and the search query contains: search&channel=products+blog, because blog was not specified in the channel parameter, it will be ignored, and just results from products channel will be searched upon. You can provide multiple channels separated by pipe and you can negate the whole set like this channel="not somechannel|anotherchannel".

dynamic=

dynamic="no"

This parameter is used to have a Results tag ignore any search data passed to the page through POST searches or the URI. So for example, you might want to have a search results page that gets affected by the search query, but you might have an additional Results tag on the page that you don't want affected by the search query.

exclude_entry_ids=

exclude_entry_ids="43|45|67"

This parameter allows you to exclude specific entries from showing in the list of results. Separate multiples with the pipe (|) character.

fuzzy_distance=

fuzzy_distance="2"

This parameter helps you indicate how close a fuzzy spelling or plural test needs to be to be considered valid. The value of this parameter needs to be an integer. Default is 2. The lesser the distance, the closer the match is to the given word. For example, detrt has a distance of 2 to detroit.

This is used in conjunction with Fuzzy Searching functionality.

fuzzy_weighting=

fuzzy_weighting="yes"

This parameter allows you to take "fuzzy searching" on keywords into account when calculating relevance. This is used in conjunction with Fuzzy Searching functionality to give more appropriate relevance scores. For example, a search for pants would likely return results for pant, but you might not want results of pant to be given the full relevance score as those with pants. By default, this parameter is set to no.

group=

group="Members"

This parameter allows you to filter the results by entries authored by member(s) of a given member group. You can use member group titles or the group ID. Separate multiples with the pipe (|) character. This parameter cannot be overwritten by data sent through POST or URI.

highlight_keywords=

highlight_keywords="b"

This parameter allows Super Search to highlight the keywords found in your search results. This only works on search terms submitted through the keywords field. Options are em, span, b, i or mark as the value of the parameter and keywords will be wrapped in the specified tag.

ignore_field=

ignore_field="some_field|some_other_field"

In the circumstance you need to display submitted value data, but not have Super Search perform a search on it, you would use this feature. Separate multiples with the pipe (|) character.

include_entry_ids=

include_entry_ids="17|33|62|79"

This parameter allows you to display only specific entries in the list of results. Separate multiples with the pipe (|) character.

include_uncategorized=

include_uncategorized="no"

When you perform category searches, by default all entries without categories will be included in the results. This parameter allows you to stop displaying those entries that have NO categories assigned to them when a category search is performed. Default is yes.

inclusive_categories=

inclusive_categories="no"

By default Super Search will find results for any of the categories submitted in a search. If you wish to find results that belong to all of the submitted categories, set this parameter to yes. Works in conjunction with category searches.

inclusive_keywords=

inclusive_keywords="no"

By default, Super Search will look for (and require) ALL terms searched upon when producing results. If you wish to override this, set this parameter to no. Default is yes.

keywords=

keywords="bird+is+the+word"

This parameter allows you to force a keyword search query into the results.

keyword_search_author_name=

keyword_search_author_name="yes"

This parameter tells Super Search to also test keywords searches against the screen names of authors of entries. If you search for the keyword Batman Robin and an entry is authored by Batman or Batman & Robin, that entry will be returned.

Unless you set the inclusive_keywords parameter to no, a search for Batman Robin will return only those entries that have Batman and Robin in the authors screen name OR Batman and Robin in the title or searchable custom fields. In other words, a search on Batman Robin would NOT return an entry that had Batman nowhere in the titles or searchable custom fields, but had Robin in the titles or searchable custom fields, and had an author with Batman in the screen name, but not Robin. Both terms must make a match in either author screen name OR titles and searchable custom fields.

Further, setting the keyword_search_author_name parameter to yes and inclusive_keywords parameter to no will cast the widest search net. Entries with Batman OR Robin anywhere in the title, searchable custom fields or author name will be returned. This parameter cannot be overwritten by data sent through POST or URI.

keyword_search_category_name=

keyword_search_category_name="yes"

This parameter tells Super Search to also test keywords searches against the names of categories assigned to entries. If you search for the keyword jacket and an entry has a category of Jacket or Winter Jacket assigned, that entry will be returned.

Unless you set the inclusive_keywords parameter to no, a search for winter jacket will return only those entries that have winter and jacket in a category name OR winter and jacket in the title or searchable custom fields. In other words, a search on winter jacket would NOT return an entry that had winter nowhere in the titles or searchable custom fields, but had jacket in the titles or searchable custom fields, and had a category assigned with jacket in the category name, but not winter. Both terms must make a match in either category name OR titles and searchable custom fields.

Further, setting the keyword_search_category_name parameter to yes and inclusive_keywords parameter to no will cast the widest search net. Entries with winter OR jacket anywhere in the title, searchable custom fields or category names will be returned. This parameter cannot be overwritten by data sent through POST or URI.

limit=

limit="50"

This parameter controls how many entries show up on your results page. Use this parameter to set the default limit of entries to be shown. If the limit parameter is sent through POST or URI, it will override the template level parameter.

max_limit=

max_limit="200"

Because the limit parameter can be overridded in the URI by users, this parameter is available as a security/performance feature. You may want to allow users to control their own limits as they please, but may very well not want a user setting the limit to 5000000 (on the same page!). Super Search has a very generous built in max value of 10000. If you wish for it to be something smaller, use this parameter and specify a value of your choice.

offset=

offset="100"

This parameter allows you to skip a specified amount of results. You can hardcode an amount of results to skip, or when using the offset parameter in the URI (or sent through POST), you can dynamically skip a specified amount of results. If this parameter is sent through POST or URI, the template level parameter will be overridden.

orderby=

orderby="entry_date+desc+title+asc"

This parameter controls the order in which entries are retrieved by Super Search. Results can be ordered by:

  • channel_name: the short name for channel
  • channel_title: full name for channel
  • entry_date (default)
  • title
  • any custom channel field
  • Solspace Rating add-on fields

Using this parameter you can set the default ordering rules of your search results page. If an order directive is sent through POST or URI though, this parameter will be overridden. To provide multiple ordering types, the syntax is to specify an order type and then the sort direction, and should look something like this: channel+asc+title+asc. To rank your results by relevance to search terms, see the relevance parameter. If you specify the relevance parameter, your results will primarily be ordered by their relevance ranking score. However, if any entries have the same relevance score, they will then be ordered by what is specified in the orderby parameter.

Additionally, in the event the order of your results is arbitrary, you can apply custom ordering to the results. For example, if you have a channel for a school class and a custom field named grade, and you'd like to order the results by grades, values could be A+, A, A-, B+, etc, which would not order correctly by default. Supply this format in the URI: search&orderby=grade+custom+'A+,A,A-,B+,B,B-,C+,C,C-' OR search&orderby=grade+custom+%22A+,A,A-,B+,B,B-,C+,C,C-%22 OR use this in the orderby parameter: orderby="grade+custom+'A+,A,A-,B+,B,B-,C+,C,C-'". You could also use this for ordering by channels: orderby="channel_name+custom+'featured,news_articles'". Remember to put quotes around the string that controls the order. This feature checks for complete/exact matches, so you would usually apply this to a field with short values. Also, when using this feature, you can only use ONE order method. So for example, if you want to perform a custom order on your grade field, you cannot supply any additional order methods like title or date, etc.

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.

partial_author=

partial_author="yes"

This parameter allows you to let partial searches of author names to happen. So a search for ste would return entries authored by Steven and Stephen. This respects the author_indicator parameter, so this applies to screen name or username (not member ID). Defaults to no.

redirect_post=

redirect_post="no"

By default, Super Search will redirect a POST search to contain the search query in the URI on the results page, similar to how it does on Google searches, etc. This allows your users to bookmark search queries, etc. To override this behaviour, specify this parameter with a value of no.

relevance=

relevance="title=5+summary=1+body=2"

This parameter allows you to apply relevance rank to entries based on keyword matches in titles and/or custom fields. See Relevance Ordering documentation for full explanation.

To have the relevance feature also search on words within words (ex: count search of cat within the word caterpillar), add +count_words_within_words to the end of your values in the relevance parameter.

relevance="title=1+summary=2+body=1+count_words_within_words"

If you specify the relevance parameter, your results will primarily be ordered by their relevance ranking score. However, if any entries have the same relevance score, they will then be ordered by what is specified in the orderby parameter.

relevance_multiplier=

relevance_multiplier="weighting_field"

This parameter allows you to increase the relevance rank of entries based on a value in a custom field. Used in conjunction with the relevance parameter. See Relevance Ordering documentation for full explanation.

relevance_proximity=

relevance_proximity="yes"

Relevance proximity only gets used when there are multiple keywords searched upon (ex: blue sweater). When it’s enabled and multiple keywords are passed, it takes into account how far apart the keywords are in the entry text (ex: i like my blue sweater is ranked higher than the sky is blue, and I’m wearing a sweater). The intention being that multi-word searches are more relevant when the search terms are closer together. To enable relevance proximity, specify a value of yes (default value of 1.3), or you can specify your own numeric value. The value you specify should be higher than 1, as the extra points are applied to entries with closer proximity keyword matches. By default, this parameter is set to no. This must be used in conjunction with the relevance parameter.

required=

required="keywords|state|country"

This parameter allows you to specify which form fields must be searched on. If any of the specified fields are not searched on, the super_search_missing_required_fields conditional will display its contents. Because of this approach, it's still possible to continue to display search results anyway, or you can hide the results from showing. Separate multiples with the pipe character. See code example for more information.

search=

search="keywords=green&channel=products&category=pants+shirts&status=-closed&orderby=title+asc&limit=100"

The Results tag doesn't always have to be used as a results landing page. You can also use it is a full replacement to the Channel:Entries tag. In addition to using standard Channel:Entries parameters, you can build a complex search query hardcoded as a parameter in the Results tag with the search parameter.

This method will override any Super Search query through POST as well as any query through the URI. The example above will fetch 100 entries whose title or searchable custom fields contain the word green, from the channel whose short name is products. It will further filter and fetch entries that belong to either the pants or shirts categories. Entries belonging to any status but closed will be retrieved. The results will be ordered by title in ascending order.

search_in=

search_in="title|body"

This parameter allows you to select which fields you want searches to search within. This field is paired up with the keywords field, and when specified, overrides default behaviour of searching within ALL searchable custom fields. Options are: title, custom_field_name, all, or a combination of title and any custom_field_name's, delimited by pipe character (|). This parameter cannot be overwritten by data sent through POST or URI.

search_words_within_words=

search_words_within_words="no"

This parameter allows you to stop Super Search from searching on words within words. Default value is yes. For example, a user might want to perform a search on cat, but they don't want to see results for catalog. This parameter cannot be overwritten by data sent through POST or URI.

show_expired=

show_expired="yes"

This parameter works just like it does for the Channel:Entries tag. Specify this parameter with a value of yes to display entries that have expired.

show_future_entries=

show_future_entries="yes"

This parameter works just like it does for the Channel:Entries tag. Specify this parameter with a value of yes to display entries that have an entry date in the future.

site=

site="site_one|site_two"

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

smart_excerpt=

smart_excerpt="no"

Based on the Enable Smart Excerpts? preference in the Super Search control panel, if set to Yes, Super Search attempts 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 Results tag respects the setting in the Super Search control panel by default, but this parameter overrides it. Used in conjunction with excerpt variable.

status=

status="not closed|pending"

This parameter allows you to hardcode status(es) for the search query. Separate multiples with the pipe (|) character. This parameter cannot be overwritten by data sent through POST or URI.

tags

tags="cheese"

You can search on one or more Solspace Tag tags in Super Search. This method looks for tags that EXACTLY match the values you specify. If you're looking for a looser method, use the tags-like field. You can also negate tags to exclude entries that are tagged with a certain tag. Just precede the tag name with a minus sign: pie+-cheese (look for pie, but NOT cheese). You can also do conjoined tag searching to find entries belonging to all of a given list of tags. Use the ampersand as the separator like this: pie&&cheese.

tags-like

tags-like="car"

This parameter allows you to perform partial match searches on tags. So if an entry is tagged with carpet, a search of car will match that.

use_ignore_word_list=

use_ignore_word_list="no"

This parameter allows you to override the Ignore Wordlist preference in the Super Search control panel. If set to yes, it will ignore any search terms in a keywords search that match words contained in the Ignore Wordlist. If set to no, no search terms will be ignored. Default behaviour (if this parameter is not specified) is to respect the preference in the control panel.

where=

where="all"

This parameter lets you specify how you want users' keyword search to be performed. Use of this parameter will override inclusive_keywords and search_words_within_words features. Used in conjunction with the keywords field. This parameter cannot be overwritten by data sent through POST or URI. Options are:

  • all - only results containing all of the specified words will be returned
  • any - results containing any of the specified words will be returned
  • exact - only results containing the entire matching phrase (case sensitive) will be returned
  • word - only results containing the exact phrase specified will be returned

wildcard_character=

wildcard_character="*"

This parameter allows you to customize what the wildcard character will be for the search query. Default value is an asterisk (*). This parameter must be used in conjunction with the wildcard_fields parameter.

wildcard_fields=

wildcard_fields="title|body|extended"

Calling this parameter allows your users to use a wildcard character on their searches. Wildcard searching only works on keywords searches (within that: title and custom field). For example, a search of cat* would return results for caterpillar and catalog. Or a search for g*se would return results for goose and geese. You can customize the wildcard character with the wildcard_character parameter. To use, specify the field names you wish to have the keyword search in, separated by the pipe character. This feature is OFF by default. To allow on all custom fields except specific ones, you can prepend the set of field names with not. Ex:

wildcard_fields="not summary|price"

Variables

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

Available outside of Super_Search: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 Results tag respects the setting in the Super Search control panel by default, but this parameter overrides it. Used inside the Super_Search:Results tag.

relevance_count

{relevance_count}

When using the relevance parameter, this variable will output the total relevance score for each result based on the matches and point values you've provided. See Relevance Ordering documentation for more information. Used inside the Super_Search:Results tag.

super_search_current_title_letter

{super_search_current_title_letter}

This variable will parse as the first letter of the current entry in the results. For example, if the entry was titled Bird is the Word, this variable would parse as B. The key purpose of this variable is to help create alphabet headers for your results when ordering by title. This is to be used in conjunction with the super_search_previous_title_letter variable, and a conditional can be used to create the alphabet header:

{if super_search_current_title_letter != super_search_previous_title_letter}
    <h2>{super_search_current_title_letter}</h2>
{/if}

Would return something like this:

A

  • Aramex
  • Avon

C

  • Carlsberg
  • Coca-Cola Company

super_search_previous_title_letter

{super_search_previous_title_letter}

This variable will parse as the first letter of the previous entry in the results. For example, if the entry result before the current entry was titled Sunshine, Lollipops and Rainbows, this variable would parse as S. The key purpose of this variable is to help create alphabet headers for your results when ordering by title. This is to be used in conjunction with the super_search_current_title_letter variable, and a conditional can be used to create the alphabet header:

{if super_search_current_title_letter != super_search_previous_title_letter}
    <h2>{super_search_current_title_letter}</h2>
{/if}

Would return something like this:

A

  • Aramex
  • Avon

C

  • Carlsberg
  • Coca-Cola Company

super_search_entry_date-from

{super_search_entry_date-from format="%Y-%m-%d"}

This variable will display the value searched for in the entry_date-from field. To apply date formatting to the value, just specify usual date formatting syntax. Used outside the Super_Search:Results tag.

super_search_entry_date-to

{super_search_entry_date-to format="%Y-%m-%d"}

This variable will display the value searched for in the entry_date-to field. To apply date formatting to the value, just specify usual date formatting syntax. Used outside the Super_Search:Results tag.

super_search_expiry_date-from

{super_search_expiry_date-from format="%Y-%m-%d"}

This variable will display the value searched for in the expiry_date-from field. To apply date formatting to the value, just specify usual date formatting syntax. Used outside the Super_Search:Results tag.

super_search_expiry_date-to

{super_search_expiry_date-to format="%Y-%m-%d"}

This variable will display the value searched for in the expiry_date-to field. To apply date formatting to the value, just specify usual date formatting syntax. Used outside the Super_Search: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:Results tag.

super_search_total_results

{super_search_total_results}

This variable will output the total number of results for the given search query. Can be used both inside or outside of the Super_Search: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: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.

super_search_required_fields

<ul>
{super_search_required_fields}
    <li>{super_search_name} or {super_search_label}</li>
{/super_search_required_fields}
</ul>

This variable pair becomes available for use within the super_search_missing_required_fields conditional, to help with parsing of error message. You would typically use this to parse a list of fields that were specified in the required and NOT searched upon. Inside of this variable pair, {super_search_name} and {super_search_label} variables are available for use. The super_search_name variable will display the short name of the custom field, while super_search_label will display the label of the custom field. See code example for more information.

Conditionals

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

next_page

{if next_page}{/if}

Just like in Channel:Entries pagination, this conditional allows you create a custom Next page link.

previous_page

{if previous_page}{/if}

Just like in Channel:Entries pagination, this conditional allows you create a custom Previous page link.

super_search_category

{if super_search_category_candy}
    Candy
{/if}
{if super_search_category_not_candy}
    Something Else
{/if} `

This conditional allows you to evaluate a POST search and/or the URI to see if a specific category was or wasn't searched upon. Syntax works like this: {if super_search_category + your_category_url_title + } or in NOT searches: {if super_search_category_not + your_category_url_title + }. Used outside the Super_Search:Results tag.

super_search_channel

{if super_search_channel_articles}
    Articles
{/if}
{if super_search_channel_not_articles}
    Something Else
{/if}

This conditional allows you to evaluate a POST search and/or the URI to see if a specific channel was or wasn't searched upon. Syntax works like this: {if super_search_channel + your_channel_short_name + } or in NOT searches: {if super_search_channel_not + your_channel_short_name + }. Used outside the Super_Search:Results tag.

super_search_status

{if super_search_status_open}
    Open
{/if}
{if super_search_status_not_closed}
    Not Closed
{/if} `

This conditional allows you to evaluate a POST search and/or the URI to see if a specific status was or wasn't searched upon. Syntax works like this: {if super_search_status + your_status_name + } or in NOT searches: {if super_search_status_not + your_status_name + }. Used outside the Super_Search:Results tag.

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.

super_search_missing_required_fields

{if super_search_missing_required_fields} {/if}

This conditional works similar to the way super_search_no_results does, but displays it's contents when specified fields in the required parameter are NOT searched on. Because of this approach, it's still possible to continue to display search results anyway, or you can hide the results from showing. Within this conditional, the super_search_required_fields variable pair becomes available to help with parsing error message. See code example for more information.

Examples

Basic Results Page

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

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

{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 query.</p>
    {/if}
    {paginate}
        <p>Page {current_page} of {total_pages} pages. {pagination_links}</p>
    {/paginate}
{/exp:super_search:results}

Results with Option to Save Search Query

The following sample code is a basic example of how your Search Results page might look with the super_search_save_search_form variable pair implemented in order to save searches to a users' history:

{exp:super_search:save_search_form}
    <p>
        <label for="super_search_name">Save this Search?<label>
        <input type="text" name="super_search_name" id="super_search_name" value="{super_search_name}" />
        <input type="submit" name="submit" value="Save!" />
    </p>
{/exp:super_search:save_search_form}

{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 query.</p>
    {/if}
    {paginate}
        <p>Page {current_page} of {total_pages} pages. {pagination_links}</p>
    {/paginate}
{/exp:super_search:results}

Results Page with Search Form

The following sample code is how your results page might look with a search form integrated to allow the user to search again and/or refine their existing search:

<h1>
    {super_search_total_results}
    results for the keyword search:
    "{super_search_keywords}"
</h1>

<hr />
<h2>Refine your Search?</h2>
{exp:super_search:form
    return="supersearch/results"
}
    <h3>Search for Products:</h3>
    <p>
        <label for="keywords">Keywords:</label>
        <input type="text" name="keywords" id="keywords" value="{super_search_keywords}" />
    </p>
    <p>
        <label for="price-from">Price from:</label>
        <input type="text" name="price-from" id="price-from" value="{super_search_price-from}" />
        <label for="price-to">to:</label>
        <input type="text" name="price-to" id="price-to" value="{super_search_price-to}" />
    </p>
    <p>
        <input type="submit" name="submit" value="Search Again!" />
    </p>
{/exp:super_search:form}

<hr />

{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 query.</p>
    {/if}
    {paginate}
        <p>Page {current_page} of {total_pages} pages. {pagination_links}</p>
    {/paginate}
{/exp:super_search:results}

Results Page with "Required" Fields

The following sample code is a basic example of how your Search Results page might look with the required parameter and super_search_missing_required_fields conditional in place:

{exp:super_search:results
    channel="articles"
    paginate="both"
    limit="10"
    required="keywords|state|country"
}
    {if super_search_missing_required_fields}
        <p>Error! The following fields are required:</p>
        <ul>
        {super_search_required_fields}
            <li>{super_search_label}</li>
        {/super_search_required_fields}
        </ul>
    {if:else}
        <div class="search_result">
            <h3>{title}</h3>
            <p>Price: ${price}</p>
            <p>{excerpt}</p>
        </div>
    {/if}
    {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:results}

Super_Search:Results behaving like Channel:Entries

The following sample code shows how you can use the Super_Search:Results tag to behave like the Channel:Entries tag (without submitting a search query to this page):

<ul>
{exp:super_search:results
    channel="articles"
    orderby="title"
    limit="10"
}
    <li><a href="{url_title_path='articles/entry'}">{title}</a></li>
{/exp:super_search:results}
</ul>

The following sample code shows how you can use the Super_Search:Results tag to behave like the Channel:Entries tag, and hardcode a search query (without submitting a search query to this page):

<ul>
{exp:super_search:results
    search="keywords=green&channel=products&category=pants+shirts&status=-closed&orderby=title+asc&limit=20"
}
    <li><a href="{url_title_path='products/entry'}">{title}</a></li>
{/exp:super_search:results}
</ul>