Need to hide menu on conditional basis

Talya
Tera Contributor

Hi All,

I need to hide the Tours menu on Employee Center header on conditional basis

If admin has configured the Tour, then the menu should be displayed to users

If there are no tours configured, then Tours option should not be displayed to end users

Talya_0-1675977380104.png

 

Appreciate any help on this.

 

Thanks,

Talya

1 ACCEPTED SOLUTION

Pooja_Patil
ServiceNow Employee
ServiceNow Employee

@Talya you can customize/clone header menu widget. For the list item that shows tours just add following condition to ng-if

&& data.guidedTours.collection.length > 0

<li ng-if="data.isLoggedIn && data.guidedTours && data.guidedTours.collection.length > 0" class="dropdown header-menu-item gtd-dropdown-container" role="presentation">

This will hide Tours from the menu when there are no tours.

View solution in original post

4 REPLIES 4

Pooja_Patil
ServiceNow Employee
ServiceNow Employee

@Talya, currently this is not possible without customization in OOB widget.

 

You can only remove the Tours menu completely by setting com.snc.guided_tours.sp.enable in sys_properties table to false.

 

Talya
Tera Contributor

@Pooja_Patil , Thanks for your reply. But I do not want to disable the Tours. 

Our requirement is to display on conditional basis. 

Any help or pointers on customizing the same?

 

Thanks,

Talya

Pooja_Patil
ServiceNow Employee
ServiceNow Employee

@Talya you can customize/clone header menu widget. For the list item that shows tours just add following condition to ng-if

&& data.guidedTours.collection.length > 0

<li ng-if="data.isLoggedIn && data.guidedTours && data.guidedTours.collection.length > 0" class="dropdown header-menu-item gtd-dropdown-container" role="presentation">

This will hide Tours from the menu when there are no tours.

@Talya did this help?