Help > Web Development > Customizing Websites > Templates > Subscribe Search

Subscribe Search

Perceptive Enterprise Search subscribe search is a method by which a user can register themselves to receive notification when a particular search finds new content.

The default Perceptive Enterprise Search websites come with a subscribed search form (templates/isys_subscribe_template.html) which allows a user to enter their details, such as email address, subscribe search title and username and password if required. It is recommended that you use this form as the basis of your modifications.

To create a subscribed search page you simply need to ensure that the form elements are named correctly. The following elements are available:

IW_SUBSCRIBE_SOURCE This is a hidden form element that must contain the result list id of the current search. This can be obtained from the {ResultID}.
IW_SUBSCRIBE_TOKEN This is a hidden form element that must contain the subscribe challenge token. This can be obtained from the {IW_SUBSCRIBE_TOKEN}.
IW_SUBSCRIBE_TITLE This is a user editable value containing the title for the subscribed search. This usually is pre-populated with "Search for {QUERY}".
IW_SUBSCRIBE_EMAIL This is a user editable value containing the email address for the user. An email will be sent to the user to validate the address.
IW_SUBSCRIBE_USERNAME This is an optional value to collect the username of the user. It is required on security websites as the subscribed search must run in the context of the searching user.
IW_SUBSCRIBE_PASSWORD This is an optional value to collect the password of the user. It is required on security websites as the subscribed search must run in the context of the searching user.
IW_SUBSCRIBE_VALIDATION This is the validation that the user must enter to create the subscribed search. The validation is the response to an automatically generated image returned from the {IW_SUBSCRIBE_IMAGE} symbol.

The subscribed search form contains several specific Perceptive Enterprise Search symbols as outlined below:

{ResultID} Returns the result list id of the current search. This is a unique number that is valid for 24 hours after the search has been executed.
{IW_SUBSCRIBE_TOKEN} Returns a unique token that has been generated for this subscribe search. It is used in conjunction with the IW_SUBSCRIBE_TOKEN form element as specified above.
{VALIDATION} This is used to validate the user's input. A validation tag is attached to each form element to ensure it has been correctly populated. The syntax is: {VALIDATION for="ElementToValidate"}
{IW_SUBSCRIBE_IMAGE} This will output an <img src="" /> tag containing a validation prompt that the user must enter to create the subscribed search.

Example

<form method="post">
  <input type="hidden" name="IW_SUBSCRIBE_SOURCE" value="{RESULTID}">
  <input type="hidden" name="IW_SUBSCRIBE_TOKEN" value="{IW_SUBSCRIBE_TOKEN}">
  
  Title: <INPUT type="text" name="IW_SUBSCRIBE_TITLE" value="Search for {QUERY}" /> 
    {VALIDATION for="IW_SUBSCRIBE_TITLE"} <br />
  
  Email: <INPUT type="text" name="IW_SUBSCRIBE_EMAIL" value="{IW_SUBSCRIBE_EMAIL}" /> 
    {VALIDATION for="IW_SUBSCRIBE_EMAIL"} <br />
  
  {IFSECURE}
  User name: <INPUT type="text" name="IW_SUBSCRIBE_USERNAME" /> 
    {VALIDATION for="IW_SUBSCRIBE_USERNAME"} <br />
  
  Password: <INPUT type="password" name="IW_SUBSCRIBE_PASSWORD" /> 
    {VALIDATION for="IW_SUBSCRIBE_PASSWORD"} <br />
  {ENDIF}

  Enter the code shown: <INPUT type="text" name="IW_SUBSCRIBE_VALIDATION" /> 
    {VALIDATION for="IW_SUBSCRIBE_VALIDATION"} <br />
  {IW_SUBSCRIBE_IMAGE}
</form>
See Also

Subscribed Search