The CreatorCon Call for Content is officially open! Get started here.

kobby_adu-nti
ServiceNow Employee
ServiceNow Employee

Some customers have reported seeing unexpected results in the CMS when using the navigation tools available on the platform; such as the 'back' button, when rendering content from their instance in a CMS portal. Content displayed in an instance can be made available in the CMS using the gsft_main frame.

The Navigation Stack is the portion of the ServiceNow suite of applications that determines where a user will be redirected. The Navigation Stack can be thought of as the end users' navigation history in the system. It is updated every time a user views a new page. However, when a record/list from main content frame is displayed on the CMS portal the end user may have navigated to this content from a page on the CMS that is not managed by the navigation stack. As a result of this we may see controls, such as the gsft_main "back" button, taking users to a page not previously visited or even a blank page. This can all be detrimental to the user's experience.

We can illustrate this in the series of images below:

1. Navigate to the user profile "/ess/profile.do"

Navigating the platform - cms 1.JPG

2. Click on the back button.

Navigating the platform - CMS 2.JPG

3. See that the end user does not end up on the page he started on

Navigating the platform - CMS 3.JPG

So what can be done to combat this behaviour?

There are two workarounds to help our user revert back to their previously visited page:

  1. Hide the button in CSS. This can be achieved with the following code:

    .navbar-btn {

      display:none;

      }

  2. Alter the 'url' definition of the   iFrame. Customers may choose to insert a new value into the sysparm_stack parameter in the url field of the iFrame, or choose to remove it altogether.

    By default the iFrame record URL field will have sysparm_stack defined OOB. Lets take the "my profile" iFrame as an example

    sysparm_stack parameter.JPG

    Updating the URL parameter from the value:

    sys_user.do?sysparm_query=sys_id=javascript:gs.getUserID()&sysparm_stack=no&sysparm_view=ess

                      to the value:

             sys_user.do?sysparm_query=sys_id=javascript:gs.getUserID()&sysparm_view=ess

    This will cause the frame to reload when you click the back button. Or try the following:

    sys_user.do?sysparm_query=sys_id=javascript:gs.getUserID()&sysparm_stack=main&sysparm_view=ess

    This will insert the main page into the stack.

For more details on the sysparm_stack parameter check out the following Service Now Wiki link:

Navigation Stack - ServiceNow.