Skip to main content
Skip table of contents

Context search mode options


This topic reviews the configuration of Real-Time Layout and Contexts as well as how the different context search modes work based on the configuration of contexts within the Real-Time Layouts.

The following section is a reference to the rpiWebClient configuration property related to Real-time Decisions search mode. This is the initial reference point for the intent of this page, but the Smartasset Results API will also be reviewed to outline how this behavior is reflected in the API as well.

The Examples section contains various configurations of the rpiWebClient initialization and how they would interact with a Real-Time layout.

Configuration property: realtimeContextSearchMode:

The Context SearchOperator(ContextSearchMode) controls how the ContextPath will be used to identify the smart assets to be evaluated:

  • IncludeSubcontexts(0) : Evaluate all smart assets that match the ContextPath or any sub context of the path provided

  • ExactPath(1) : Evaluate only smart assets that match the ContextPath

  • IncludeParentContexts(2) : Evaluate all smart assets that match the ContextPath or any parent within the context hierarchy

  • FirstParent(3) : Evaluate all smart assets that match the ContextPath, or if not found, the first match up the context hierarchy


This RTD Context Paths file contains the base HTML used in the examples.

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>#rpipage{top: 0px; right: 0px; bottom: 0px; left: 0px; width:800px; height: 100%; margin: auto;}</style>
<script type="text/javascript" src="C:\inetpub\wwwrpi\InteractionRealtimeAPI\rpiwebclient\rpiWebClient.config.js"></script>
<script type="text/javascript" src="C:\inetpub\wwwrpi\InteractionRealtimeAPI\rpiwebclient\rpiWebClient-6.6.js"></script>
<div id="Layer1">No Result 1</div>
<div id="Layer1-1">No Result 1-1</div>
<div id="Layer1-2">No Result 1-2</div>
<div id="Layer1-1-1">No Result 1-1-1</div>
<div id="Layer1-2-1">No Result 1-2-1</div>
<script type="text/javascript">
  contexts: ["Layer1"],
  realtimeContextSearchMode: 0,
  "clientId": "11111111-1111-1111-1111-111111111111",
  "serverUrl": "",
  "enableLinkTracking": true

There are 5 divs in the file, each of which corresponds to one of the SmartAssets in this Real-Time Layout:

Realtime Layout

The Smart Assets contain an inline text element of their name. When the rpiWebClient returns a Smart Asset, its name will appear in the output (e.g., Layer1-1-1). If it did not return a Smart Asset, the displayed text would be No Result 1-1-1.

Also note that the ContextPath in the context's parameter must always exactly match the Real-Time Layout. Layer1 and Layer1/Layer1-2 are both valid, but Layer1-2 is not.


contexts: [“Layer1”]

contexts: [“Layer1/Layer1-2”]
contexts: [”Layer1”] - no match on rule for Layer1-1


contexts: [“Layer1/Layer1-2”]
contexts: [“Layer1/Layer1-2”,”Layer1/Layer1-1/Layer1-1-1”]


contexts: [“Layer1/Layer1-2”]
contexts: [“Layer1/Layer1-2”,”Layer1/Layer1-1/Layer1-1-1”]
contexts: [”Layer1/Layer1-1/Layer1-1-1”] - no match on rule for Layer1-1


contexts: [“Layer1/Layer1-2”]

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.