- 09 Oct 2024
- 4 Minutes To Read
-
Print
-
DarkLight
-
PDF
URL Properties as Visibility Rules
- Updated On 09 Oct 2024
- 4 Minutes To Read
-
Print
-
DarkLight
-
PDF
Introduction
URL Properties enable you to uniquely identify a web page to show Whatfix content and widgets. These properties can be added as a Visibility or Display Rule condition to your Whatfix content and widgets, as required.
The following are the URL Properties:
- URL
- URL Hostname
- URL Path
- URL Parameters
- URL Hash
Types of URL Properties
URL
Use the URL criteria to specify the entire URL that you want to use as a Visibility or Display Rule.
Whatfix enables you to add dynamic URLs also. For more information on how to use dynamic URLs as a Visibility Rule, see the use cases mentioned in this article.
URL Hostname
Use this condition when you want to uniquely identify a page using the domain name. The URL Hostname is the first part of any URL.
Example: If you wish to display the tip only when you are on ap17.lightning.force.com, add a condition as shown in the following image:
URL Path
The website pathname is the part that you see after your domain name but before the parameters or hashes.
Example: If the website URL is 4https://ap17.lightning.force.com/lightning/#lead/
list?filterName=Recent, then the pathname is /lightning.
URL Parameters
If you want to identify your web page using the parameters on the URL, you can use this condition.
Example: If you want to show a tip to a user only when they filter for Recents, you can add a condition as shown in the following screenshot.
URL Hash
If you want to identify a page using the hash value of your URL, use this condition. Hashes are usually present in Single page applications developed using AngularJS or ReactJS. There are no page refreshes but only Hash changes.
Example: If you want to show a tip to a user only when they go to the Lead page, add a condition as shown in the following image:
Use Cases
Use the following steps to configure the Visibility rules in a widget:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Contains.
-
Copy the URL value that is common across all the pages of your application, and then paste it under the URL section.
-
Click Save.
Use the following steps to configure the Visibility rules in a widget:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Not Equals.
-
Copy the Browser URL of the page you don't want the widget to appear, and then paste it under the URL section.
-
Click Save.
Use the following steps to configure the Visibility rules in a widget:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Contains.
-
Copy the URL value that is common across all the pages of your application, and then paste it under the URL section.
-
Click Save.
Pre-requisite:
To prevent a widget from appearing on a page, you need to identify the URL path value specific to the page that you want to exclude.
Use the following steps to configure the Visibility rules in a widget:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Contains.
-
Copy the URL value that is common across all the pages of your application, and then paste it under the URL section.
-
Click the Plus icon.
-
Select URL as the display rule condition.
-
Under the Operator section, select Not Contains.
-
Copy the URL value specific to the page you don't want the widget to appear on, and then paste it under the URL section.
-
Click Save.
A dynamic URL has a URL path that is divided into two parts. One part of the URL path is dependent on user-defined variables, that keep changing to display specific information depending on user inputs. The other part of the URL path is independent of user inputs and remains common throughout the application.
To display a widget on an application having a dynamic URL, you need to identify the two parts of the application URL.
If the URL path ends with a dynamic value, then while configuring the Visibility rules in a widget, use the following steps:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Starts With.
-
Copy the independent URL path value, and then paste it under the URL section.
-
Click Save.
If the URL path begins with a dynamic value, then while configuring the Visibility rules in a widget, use the following steps:
-
Under the Visibility Rules condition, select URL.
-
Under the Operator section, select Ends With.
-
Copy the independent URL path value, and then paste it under the URL section.
-
Click Save.