How to Configure Documents Thumbnails

Prerequisites

Smart Previews for SmartHub must be installed for the document thumbnails to be displayed.

About Documents Thumbnails

Document Thumbnails is a new feature that applies to your SmartHub site's Index.html page.

  • SmartHub's default Index.html page is located at the SmartHub root level.

The default Index.html page is overwritten at upgrade time.

BA Insight recommends using a custom Index.html page for page customizations.

For information about using custom pages, see How to Customize Your SmartHub User Interface.

Document Thumbnails in the SmartHub UI

  • Document Thumbnails replaces the default icon displayed for the Recommendations results with the thumbnail of the first page of the document.
  • This replacement happens only for documents that have generated previews.
  • Otherwise, the default icon based on the extension of the file is displayed.

How to Configure Documents Thumbnails

In order for documents thumbnails to appear on a custom Index.html page (see About Documents Thumbnails section), follow the steps below.

Note: The line numbers in the example below used are from the provided sample custom Index file IndexCopy.html from <SmartHub-root>\CustomerCustomization\pages.

  1. Open your custom HTML page, such as a custom Index.html page.
  2. Add a data-clickUri attribute on the image elements from the PersonalizedRecommendations Content-By-Search, shown added, below:

    <img data-clickUri="<%= raw.clickUri %>" src="<%= SH.utils.getIconUrl(raw.filetype) %>" />




  3. Navigate to the path<SmartHub_root_folder>/modules/SmartHubResourceLoaderand open theDefaultModuleSettings.js file.


  4. Copy the Thumbnails settings section from SH.SmartPreviews.DefaultSettings. In the example above, this section is contained in lines 287 to 292.
  5. Go to your custom settings file (DO NOT change any of the default settings, they are overwritten when SmartHub is upgraded).

  6. Paste the copied settings inside the section SH.SmartPreviews.CustomSettings.

  7. Change the Recommendations section or add a new one as follows: 

    The name of the section must be the id attribute of the HTML element for the CBS.

    1. Enabled: Set to "true" to display the documents thumbnails for the selected container.
    2. ResultsSelector: The selector used to get the results list for which the documents thumbnails will appear.

How to Set Document Thumbnail Size

The thumbnails size can be modified as follows:

  1. Locate and open the configuration files found in the bin folder from the Smart Previews Import Server (<SmartPreviewsForSmartHub_root>\SmartPreviewsFrontEnd\bin)
    1. Preview offline: PreviewGeneratorV5.exe.config
    2. Preview online (on-demand): AptivCachePreviewGenerator.exe.config
  2. Modify the values for the following settings (size in pixels):
    1. ThumbnailMaxWidth
    2. ThumbnailMaxHeight



  3. After modifying the configuration files, restart Smart Previews services for the changes to take effect.