Super Search 3.x

Legacy documentation for Super Search 3.x.

Super_Search:Save_Search_Form template tag

The Super_Search:Save_Search_Form tag allows your users to save their searches. Once a user has completed a search, they have the option to save the search and give it a name of their choice. These saved searches are then available to see using the Super_Search:History tag.

Typically, you would be placing this tag on your search results page (outside of the Super_Search:Results loop) to allow users to save their search queries.

{exp:super_search:save_search_form} content {/exp:super_search:save_search_form}


The following parameters are available for use:



This parameter switches the form to operate in Delete mode. When you submit the form in Delete mode, the given search identified by the search_id parameter is deleted from your history.



This parameter allows you to control any form attribute for the form in your template. Simply replace attribute with an attribute name such as id, name, class, etc, and specify a value for that attribute. You can specify this parameter multiple times to control as many attributes as necessary. This would normally be done to control your form with Javascript or style it with CSS.



This parameter allows you to indicate an onsubmit action for your form.



This parameter determines where to send users once they have submitted the form.



You can load a search ID into this parameter to allow someone to edit the name they have given to one of their searches. If no search ID is provided in this parameter, the form will fetch the last search the user executed, thus allowing them to provide a name for the search, submit the form, and add that most recent search to their search history. If the current user is NOT a logged in member (Guest), Super Search changes to cookie based identification, and the searches are saved that way.


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 name given to the search. Defaults to Search if a name has not yet been given to the search.



This variable will output the total number of results in the search.


Saving a Search Query

The following sample code is a basic example of how your Search Results page might look with the Save_Search_Form tag implemented in order to save searches to a users’ history:

        <label for="super_search_name">Save this Search?<label>
            value="{super_search_name}" />
        <input type="submit" name="submit" value="Save!" />

    <div class="search_result">
        <p>Price: ${price}</p>
    {if super_search_no_results}
        No results matched your query.

Edit a Saved Search Query

Below is an example of how you would use the Save_Search_Form tag to edit the names of existing saved searches, assuming you have the search ID in the 3rd segment of the URI:

    <h3>Edit this Search?</h3>
    <p><input type="text" name="super_search_name" value="{super_search_name}" /></p>
    <p><input type="submit" name="submit" value="Save!" /></p>

Delete a Saved Search Query

Below is an example of how you would use the Save_Search_Form tag to delete existing saved searches, assuming you have the search ID in the 3rd segment of the URI:

    <h3>Are you sure you want to Delete the Search named "{super_search_name}"?</h3>
    <p><input type="submit" name="submit" value="Yes, Delete" /></p>