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 whether Magnify is configured with the GSA or a Lucene index.

Any changes made to the Magnify style sheet requires you to restart the application server or issue the &proxyreload=1 request parameter on the browser URL.

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

\ibi\WebFOCUS\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:

If your Magnify application is configured with GSA, the Page Layout Helper tool can be used to update certain elements within the style sheet. Please refer to the GSA documentation for more information on using the Page Layout Helper tool. Otherwise, any XSLT editor can be used to update the style sheet.

The \ibi\WebFOCUS\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. For 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 is returned by Magnify after a query is submitted. For example,


Top of page

x
Procedure: How to Enable Spell Checking
  1. Edit the included_stylesheet.xslt in the \ibi\WebFOCUS\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. Issue the &clearcache=1 API parameter in the URL to reflect the changes to the style sheet.

Top of page

x
Procedure: How to Style Matched Content in a Search Result Title
  1. Edit the included_stylesheet.xslt in the \ibi\WebFOCUS\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  }

Top of page

x
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\WebFOCUS\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>

Top of page

x
Procedure: How to Configure the Magnify Logo
  1. Edit the included_stylesheet.xslt in the \ibi\WebFOCUS\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.

Top of page

x
Procedure: How to Enable the Secure Radio Button
  1. Edit the included_stylesheet.xslt in the \ibi\WebFOCUS\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>

Top of page

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

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

Top of page

x
Procedure: How to Modify the Magnify Home Page
  1. Edit the included_stylesheet.xslt in the \ibi\WebFOCUS\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 that will display in the Magnify homepage.
    <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 as follows:
     <!-- **********************************************************************
     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