Super Search 3.x

Legacy documentation for Super Search 3.x.

Super_Search:History template tag

The Super_Search:History method allows your users to view their search history. It displays a list of all saved search queries. A member may only view their own history, and cannot view someone else's history for privacy reasons. Searches must first be saved using the Super_Search:Save_Search_Form function upon completion of a search.

Each search query is saved to the database and given a unique search ID. That ID is then passed over to the Super_Search:Form tag, where Super Search will then parse and fill out all search query terms originally supplied for each search field.

{exp:super_search:history} content {/exp:super_search:history}


The following parameters are available for use:



This parameter allows you to control how many results will be outputted. The default is 20.



This parameter allows you to specify whether to order your results by total number of results for the query (results) or the date the search was saved (date). Use the sort parameter to control whether the list is ascending or descending.



If this parameter is set to yes, only searches saved in your history will be shown. If set to no, only the last search you performed will be shown. Default is yes.



This parameter is used in conjunction with the orderby parameter, and allows you to control whether the list is ascending (asc) or descending (desc).


The following variables are available for use:


{super_search_date format="%l, %F %j, %Y at %g:%i %a"}

This variable will output the date of when the search was performed.



This variable will output the ID of the search. This variable will be used to construct a link to your search form, and pass the search query ID to it.



This variable will output the name given to the search.



This variable will output the total number of results for the search query.



This variable will evaluate as y or n, depending on whether the search query was saved. This would likely be used as a conditional.



This variable will return the relative position number of the search query within the list of queries.



This variable will return the total amount of search query history results being displayed. You would typically use this in a conditional statement.


Conditionals are available on all variables. Additionally, the following conditionals are also available for use:


{if super_search_no_results}
    Sorry, no results were found.

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


The following code sample is an example of how your Search History list might look:

<h3>Your Saved Searches</h3>

    {exp:super_search:history limit="10"}
            <a href="{path='supersearch/search'}/{super_search_id}/">
            {super_search_results} results
            (searched on {super_search_date format="%F %j, %Y at %g:%i %a"})
        {if super_search_no_results}
            <li>You have not saved any searches yet.</li>