How to Customize Your SmartHub User Interface

Note: In addition to the following instructions, for an example of customizing SmartHub, see How to Add a Tabular View to Your Results Page.

Upgrade Warning: When upgrading from SmartHub v5.x to SmartHub v6.x the custom settings files should be checked because some features, names and labels have been slightly modified.

 

About the Files that Control the SmartHub User Interface

SmartHub Web Pages: Defaults

The files described in the table below contain the code responsible for your SmartHub Index (or landing page), and Results pages.

  • If you wish to modify the appearance of SmartHub, DO NOT change these files.
  • All out-of-the-box HTML pages are overwritten when you upgrade SmartHub.
SmartHub Page Page Details Location

Landing.html

  • A jump off page where users enter their search query.
    • Alternative: Index.html
  • This file is overwritten when SmartHub is upgraded.
  • Note: You must point your SmartHub IIS site to load this file as the default starting page. See "How to Set SmartHub to Use a Custom Index or Landing Page" below.
  • local machine\<SmartHub root directory>

Example:

  • (On the machine SmartHub is installed on): C:\Program Files\BAInsight\SmartHub\SmartHub-5\Landing.html

Index.html

  • A jump off page where users enter their search query.
    • Alternative: Landing.html
  • This file is overwritten when SmartHub is upgraded.
  • Note: If you choose to use a custom version of this file you must point your SmartHub IIS site to load this file as the default starting page. See "How to Set SmartHub to Use a Custom Index or Landing Page" below.
  • local machine\<SmartHub root directory>

Example:

  • (On the machine SmartHub is installed on): C:\Program Files\BAInsight\SmartHub\SmartHub-5\Index.html

Results.html

  • Displays query results to the user, including SmartHub features such as refiners, document summary, interactive help, etc.
  • For a list of customizable features that can be loaded on this page, see How to Configure Your Search Center.
  • This file is overwritten when SmartHub is upgraded.
  • local machine\<SmartHub root directory>

Example:

  • C:\Program Files\BAInsight\SmartHub\SmartHub-5\Results.html

SmartAutomations.html

  • A jump off page where users have an easy access to the available SmartAutomations.

  • This file is overwritten when SmartHub is upgraded.

  • local machine\<SmartHub root directory>

Example:

(On the machine SmartHub is installed on): C:\Program Files\BAInsight\SmartHub\SmartHub-6\SmartAutomations.html



How to Modify Your SmartHub User Interface

Note: Customizing the SmartHub User interface can be done only by a user that has one of the following roles: "Admin" or "Designer".
WARNING:
  • All the available module settings can be seen in the file DefaultModuleSettings.js at <SmartHub root>\modules\SmartHubResourceLoader\DefaultModuleSettings.js.

    Do not modify this file

How to Set SmartHub to Use a Custom Index or Landing Page

Follow the steps below to direct SmartHub to load your custom Index.html file ("MyIndex.html" in the example below):

Note: In the case of an upgrade, the setting of the "Default Document" from IIS is deleted.

  • Follow these steps to reset the IIS "Default Document" for your SmartHub site.

  1. Locate your custom Index page file (by default, IndexCopy.html).
  2. Open Internet Information Services (IIS), and select your SmartHub site.
  3. Click "Default Document".


  4. Click the "Add" link under the Actions menu on the right side and enter the name of your custom Index file ("IndexCopy.html" or "MyIndex.html", for example) to add your index page as the default root page.

  5. Your custom Index file appears as the new default root page:

SmartHub Components

Note: SmartHub v6.x no longer supports the ResultList and the ContentBySearch component.

You must migrate to the ContentContainers component.

  • Each SmartHub component is found in its own directory, under \modules, as shown in the graphic below.
  • Each SmartHub component stores its settings in the same file: <SmartHub root>\modules\SmartHubResourceLoader\DefaultModuleSettings.js.
  • Component settings are used to change the behavior and/or appearance of the component.
  • To alter a component's settings, the settings are copied into the appropriate section of your custom settings file, and modified from there.
  • The custom setting file can be accessed from the UIBuilder in Advanced Mode via the Advanced Settings edit tab
SmartHub \modules Directory Module/Component Documentation Topic/Description

AdvancedSearch How to Configure the Advanced Search Module
Analytics Text Analytics
AuthDialog Authentication module. Not used for customization
Authentication External Authentication module. Not used for customization
Basket How to Use the SmartHub Basket
BubbleSuggestions
CarouselView  
ChartView How to View Numeric Query Results in a Chart View
ChatBot

How to Use Interactive Help

ContentContainers How to Add the Content Containers Module
ContentFeedback  
ContentIntelligence How to Use Embedded Content Intelligence
Expertise  
FacetDatePicker How to Configure the DatePicker Refiner
HoverPanel How to Preview Documents with the Hover Panel
LearnToRank How to Use Learn-To-Rank Features
MultiLanguage How to Enable Multi-language Support
Onboarding  
PageFeedback How Users Can Submit Feedback
Personalization How Users Can Personalize Their Search Results
ProximitySearch How to Refine Search Results by Term Proximity
PubChem internal feature. Not for client use.
Ratings How Users Can Rate Search Results
Ribbon

How to Configure User Profile and Picture Providers

How to Modify Your SmartHub Page Banner or "Ribbon"

SavedQueries How Users Can View Saved Queries and Query History
ScopedSearchRedirect How to Redirect Users to Scoped Results
SearchBox How to Configure the SearchBox
SearchMenu .How to Configure the Search Menu
SimilarDocuments How to Discover Similar Documents in Search Results
SmartAutomations Interact with AppBus via Smart Automations
SmartHubResourceLoader Loads all other components. Described below.
SmartPreviews Smart Previews loader
SpellCheck Customize spell check functionality
Summary How to Display a Document Summary in its Own Window
TabularView How to View Query Results in a Tabular View
TagCloud How to Create a Word Cloud in Your Search Center
TypeAhead How to Create TypeAhead Query Suggestions

Direct SmartHub to Use Your Custom Results HTML File

Your custom settings file overrides all other settings

  1. SmartHub, by default, loads the file Results.html.
  2. Once you have made a custom Results HTML file, you must direct SmartHub - specifically your Index HTML file - to load the file instead of the native Results.html file.
  3. To do this, you need to copy (and modify) a setting from your default Index Page settings file into your custom Index settings file.
    1. Open the Index page via the UIBuilder in Advanced Mode and go to the Advanced settings edit.

    2. Copy the following code:

    3. Code to modify for redirect
      Copy
         "/modules/Authentication/OAuth.js": {
                 "params": {
                     "id": "OAuth",
                     "data-redirect-uri": SH.RootLevelURL + "/Results.html"
                 }
             }
    4. Open your custom Index page via the UIBuilder in Advanced Mode and go to Advanced settings edit.

    5. Paste the copied code in the SH.Loader.FilesToLoad section.

    6. Modify the value "data-redirect-uri" to point to your custom Results HTML file.

      1. For example, "data-redirect-uri": SH.RootLevelURL + "CustomResults.html".

    7. When SmartHub loads, your Index Page loads its custom setting file which now includes the redirect to your new Custom Results HTML page.

    8. In turn, whatever values your Custom Results HTML file contains are also used.

    9. Your Custom Results HTML file pulls its settings from its settings file, ResultsPageSetting.js, or else from a custom results settings file, if you have created one.

Note: When you want to add/remove components (or change their parameters) from a page, do not change the DefaultModuleSettings.js file directly, as it is subject to change in future SmartHub versions.

Instead, make modifications by opening the page in UIBuilder Advanced mode and going to the Advanced settings edit tab. See "SmartHub Custom Settings Files," above.

Adding a Custom Version to a Specific File

  • In order for browsers to cache the SmartHub files for a better performance, we append the SmartHub version to all the files.

  • In case that, you want to use a custom file, and you don't want that file to be cached by browsers or you want to have a specific version, CSS/JS files supports 'version' parameter.

Example:

Copy
SH.Loader.FilesToLoad = {

    //adding files
        '/modules/my-css.css': {
        'version':'1.0.1'    
    },
        '/modules/my-js.js': {
        'version':'1.0.1'
    },
};

Example: Exclude the SavedQueries Module

Some users prefer not to load certain modules for various reasons, such as eliminating unwanted visual objects in the user interface.

  • To exclude a module from loading, locate the module - found within <SmartHubInstallation>/modules/<ModuleName>.

In the following example the SavedQueries module is excluded.

  1. The SavedQueries.js file is shown in the /modules/SavedQueries.js
  2. The path to the Saved Queries module is inserted within brackets [ ] under the "SH.LoaderPathsToExclude =" section.
Copy
SH.Loader.PathsToExclude = [
   ["/modules/SavedQueries/SavedQueries.js"]
];  
  • This excludes the SavedQueries module from loading.