ServiceNow Announcement to display on one page of the portal

Miroslaw M
Tera Contributor

Hi all,

 

I created an announcement banner and widget on one of my portals, however the functionality with limiting the announcement banner to display only on one of the pages of my portal seems to be lacking. Was anyone able to find a way to display the banner on only one page in a portal? (For now i just added the widget to the one page and not others but this does not seem as clean as the banner

 

Widget:

Screen Shot 2023-07-26 at 9.16.12 AM.png

 

Banner:

Screen Shot 2023-07-26 at 9.17.04 AM.png

  

1 ACCEPTED SOLUTION

Tushar
Kilo Sage
Kilo Sage

Hi there,

 

In ServiceNow, there is no out-of-the-box feature to limit an announcement banner widget to display only on one specific page of a portal. By default, widgets are meant to be added to a portal globally, meaning they will appear on all pages within that portal.

However, there you can try below workaround -

 Create a custom widget that displays the announcement banner and includes a condition in the widget's client-side JavaScript to check the current page URL. If the current page matches the specific page where you want the banner to appear, then display the banner; otherwise, hide it.

 

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar

View solution in original post

6 REPLIES 6

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

"the functionality with limiting the announcement banner to display only on one of the pages of my portal seems to be lacking"

 

Which functionality do you mean here? I don't believe there is such, so can you please clarify.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Tushar
Kilo Sage
Kilo Sage

Hi there,

 

In ServiceNow, there is no out-of-the-box feature to limit an announcement banner widget to display only on one specific page of a portal. By default, widgets are meant to be added to a portal globally, meaning they will appear on all pages within that portal.

However, there you can try below workaround -

 Create a custom widget that displays the announcement banner and includes a condition in the widget's client-side JavaScript to check the current page URL. If the current page matches the specific page where you want the banner to appear, then display the banner; otherwise, hide it.

 

Please, don't forget to mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Regards,
Tushar

Thank you very helpful answer, and seems like its exactly what i thought the case would be. No OOB way to do it but perhaps customizing it could do the job - Juice is most likely not worth the squeeze. Thanks. 

Jim Coyne
Kilo Patron

I'm a little confused as you seem to have the perfect solution: running a widget on the specific page.

 

Why would you want to have the widget in the banner, run for every page and figure out if it should actually display the announcement or not.  Obviously I don't know your setup, but it would seem that the announcement would only appear on a small number of visits to the portal, so why have it do all the work for nothing most of the time?

 

You can certainly style the widget announcement to look more like the banner one.