Customization Overview

How to:

Magnify provides a simple, easy-to-use interface that is very similar to the one used by the Google Search Appliance. Magnify uses an XSLT style sheet to create the interface by which the user interacts. Developers can use this style sheet to customize various elements on the interface. Also, search results can be enhanced to contain more information (such as date or custom snippet content) by configuring fields stored in the index and exposing their values in each search result. The customizations described in the following sections apply when Magnify is configured with a Lucene index.

Any changes made to the Magnify style sheet requires you to restart the application server.

By default, the Magnify XSLT style sheet is located in:

\ibi\WebFOCUS82\config\magnify\locale\locale_stylesheet.xslt

where:

locale

Is the subfolder name for each language Magnify supports to provide localized interfaces. The following languages are available:

  • Chinese
  • English
  • French
  • French Canadian
  • German
  • Japanese
  • Mandarin
  • Portuguese
  • Russian
  • Spanish

The \ibi\WebFOCUS82\config\magnify\included_stylesheet.xslt file contains templates for customizing the various components on the Magnify interface and is dynamically included in the Magnify style sheet at run time. Each component can be hidden or displayed and contains customizable attributes, such as color, alignment, and size, as shown in the following example.

You can expose additional information in the interface to enhance the search results of your Magnify application. To use information stored in the index, the field name and its value must be retrieved and configured in the style sheet. By default, the Magnify style sheet has immediate access to field names and values contained in the XML that Magnify returns. For example,

Procedure: How to Sort by the Sentiment Score

By default, the Magnify interface enables users to sort by the sentiment score. The sorting option is configured in \ibi\WebFOCUSxx\config\magnify\included_stylesheet.xslt.

  1. Edit the \ibi\WebFOCUSxx\config\magnify\included_stylesheet.xslt file.
  2. To enable sorting by the sentiment score, edit the show_sort_by_sentiment variable as follows:
    <xsl:variable name="show_sort_by_sentiment">1</xsl:variable>
  3. To disable sorting by the sentiment score, edit the show_sort_by_sentiment variable as follows:
    <xsl:variable name="show_sort_by_sentiment">0</xsl:variable>
  4. Reload the Magnify stylesheet by restarting the application server.

Procedure: How to Enable Spell Checking

  1. Edit the included_stylesheet.xslt file in the \ibi\WebFOCUS82\config\magnify directory.
  2. Locate the following syntax in the included_stylesheet.xslt file:
    <input type="hidden" name="spelling" value="false"/>
  3. Change the value attribute to true as follows:
    <input type="hidden" name="spelling" value="true"/>
  4. Restart the application server or use the Refresh Collections option in the Magnify administration console to reflect the changes to the style sheet.

Procedure: How to Enable Mobile Auto-Detection

  1. Edit the included_stylesheet.xslt file in the \ibi\WebFOCUS82\config\magnify directory.
  2. Locate the isMobile template (<xsl:template name="isMobile">).
  3. For each of the <xsl:when test="contains($useragent,'devicex')">false</xsl:when> tags, where devicex is the device you are enabling or disabling, set the value to true (enable) or false (disable).

    Note: Blackberry® is disabled by default.

Procedure: How to Style Match Content in a Search Result Title

  1. Edit the included_stylesheet.xslt file in the \ibi\WebFOCUS82\config\magnify directory.
  2. Locate the following syntax in the included_stylesheet.xslt file:
    span.highlighttitle { font-weight: normal }
  3. Change the span.highlighttitle attribute to one of the following:
    span.highlighttitle { font-weight: bold }

    or

    span.highlighttitle { font-weight: bold; font-size:15px;text-decoration:underline  }

Editing a Procedure to Style a Search Result Title

In addition to editing the included_stylesheet.xslt file to adjust the appearance of a search result title, you can add styling instructions to the procedure before it is fed into Magnify Search and converted into a search index. In this file, you can edit the SEARCHTITLE/A1000 code line to make search result titles appear in italics or in bold.

Note: You cannot add search result title styling options to both the included_stylesheet.xslt file and the procedure at the same time. Choose one file that will contain these styling conditions.

The following example shows the SEARCHTITLE/A1000 code line edited to make search result titles display as bold.

SEARCHTITLE/A1000='<b>' || CAR | ' (' || COUNTRY || ')</b>';

The following example shows the SEARCHTITLE/A1000 code line edited to make search result titles display as italic

SEARCHTITLE/A1000='<i>' || CAR | ' (' || COUNTRY || ')</i>';

Procedure: How to Define a Single Default Collection

  1. Locate the following syntax in the included_stylesheet.xslt file:
    <xsl:variable name="show_collections">1</xsl:variable>
  2. Disable the collections drop-down list as follows:
    <xsl:variable name="show_collections">0</xsl:variable>
  3. Edit the \ibi\WebFOCUS82\config\magnify\collections.xml file and rename the default collection defined in the indexes element tag as follows:
    <indexes>
         <index name="default_collection_old" directory="."/>
    </indexes>
  4. In the collections.xml file, create a group under the collections element tag called default_collection as follows:
    <collections>
        <group name="default_collection" id="default_collection">        
           <component id="customers" member="customers"/> 
           <component id="employees" member="employees"/> 
        </group>
    </collections>

Procedure: How to Configure the Magnify Logo

  1. Edit the included_stylesheet.xslt file in the \ibi\WebFOCUS82\config\magnify directory.
  2. Locate the following syntax:
    <xsl:variable name="logo_url">images/search/magnify/logo.png</xsl:variable>
  3. Modify the logo_url value to contain the path to an image that is accessible using the web server or on a physical drive.

Procedure: How to Enable the Secure Radio Button

  1. Edit the included_stylesheet.xslt file in the \ibi\WebFOCUS82\config\magnify directory.
  2. Locate the following syntax in the included_stylesheet.xslt file:
    <xsl:variable name="show_secure_radio">0</xsl:variable>
  3. Change the show_secure_radio variable as follows:
    <xsl:variable name="show_secure_radio">1</xsl:variable>

Procedure: How to Configure the Spacing Between Main Title Link and Snippet

  1. Edit the included_stylesheet.xslt file in the \ibi\WebFOCUS82\config\magnify directory.
  2. Locate the following syntax in the included_stylesheet.xslt file:
    <p/>
    <xsl:choose>
    <xsl:when test="$type ='snippet'">
    <xsl:call-template name="nbsp"/>
    <div>
    <xsl:variable name="br_html">&lt;br&gt;</xsl:variable>
  3. Comment out the <p> as follows:
    <!--p--><xsl:choose>
    <xsl:when test="$type ='snippet'">
    <xsl:call-template name="nbsp"/>
    <div>
    <xsl:variable name="br_html">&lt;br&gt;</xsl:variable>

Procedure: How to Modify the Magnify Home Page

  1. Edit the included_stylesheet.xslt file in the \ibi\WebFOCUS82\config\magnify directory.
  2. Locate the following syntax in the included_stylesheet.xslt file:
    <!-- **********************************************************************
    My global page header/footer (can be customized)
    ********************************************************************** -->
    <xsl:template name="my_page_header">
    <!-- *** add your xhtml here - suggest styling via #ph (header) or .phf (header/footer) -->
    </xsl:template>
    <xsl:template name="my_page_footer">
    <!-- *** add your xhtml here - suggest styling via #pf (footer) or .phf (header/footer) -->
    </xsl:template>
  3. Create a template using HTML syntax for the page body section (such as the following) that will display in the Magnify home page.
    <xsl:template name="customhomepage">
       <xsl:text disable-output-escaping="yes">
           <Encoded HTML>
       </xsl:text>
    </xsl:template>

    Note: All HTML syntax must be encoded.

  4. Locate the following syntax:
     <!-- **********************************************************************
     Search result page header (can be customized): logo and search box
         ********************************************************************** --> 
    <xsl:template name="result_page_header"> 
       <xsl:if test="/GSP/PARAM[@name='usernametodisplay']/@value != ''">
          <div style="text-align:right"> <xsl:value-of select="$user"/>
            <xsl:call-template name="nbsp"/>
            <xsl:value-of select="/GSP/PARAM[@name='usernametodisplay']/@value"/>
          </div> 
       </xsl:if>
      
       <xsl:if test="$show_logo != '0'">
         <xsl:call-template name="logo"/>
       </xsl:if>
       <xsl:if test="$media != 'handheld'">
          <xsl:if test="$show_skip_links != '0'">
            <xsl:call-template name="skip_links"/>
          </xsl:if>
          <xsl:if test="$show_top_search_box != '0'">
             <xsl:call-template name="search_box">
                <xsl:with-param name="type" select="'std_top'"/>
             </xsl:call-template>
          </xsl:if>
       </xsl:if>
      <xsl:if test="/GSP/CT">
        <p id="sw"><xsl:call-template name="stopwords"/></p>
      </xsl:if> 
    </xsl:template>
  5. Add the following syntax to the result_page_header template:
     <!-- **********************************************************************
     Search result page header (can be customized): logo and search box
         ********************************************************************** --> 
    <xsl:template name="result_page_header"> 
       <xsl:if test="/GSP/PARAM[@name='usernametodisplay']/@value != ''">
          <div style="text-align:right"> <xsl:value-of select="$user"/>
              <xsl:call-template name="nbsp"/>
              <xsl:value-of select="/GSP/PARAM[@name='usernametodisplay']/@value"/>
          </div> 
       </xsl:if>
       
       <xsl:if test="$show_logo != '0'">
          <xsl:call-template name="logo"/>
       </xsl:if>
       <xsl:if test="$media != 'handheld'">
           <xsl:if test="$show_skip_links != '0'">
              <xsl:call-template name="skip_links"/>
           </xsl:if>
           <xsl:if test="$show_top_search_box != '0'">
              <xsl:call-template name="search_box">
                 <xsl:with-param name="type" select="'std_top'"/>
              </xsl:call-template>
           </xsl:if>
       </xsl:if>
       <xsl:if test="/GSP/Q =''">
          <xsl:call-template name="customhomepage"/></p>
       </xsl:if>   <xsl:if test="/GSP/CT">
          <p id="sw"><xsl:call-template name="stopwords"/></p>
       </xsl:if> 
    </xsl:template>

WebFOCUS

Feedback