We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

To display Custom announcement only on one Topic page.

Not applicable

Hi, How can I configure an announcement (message) to be displayed exclusively on a specific sub-topic page within a taxonomy? 

1 ACCEPTED SOLUTION

Not applicable

Finally, I found a solution. I will leave it here for the dear developers.

I created a widget and added that widget to the taxonomy page using the page designer.

 

html

<div class="alert" ng-if="c.showAlert">
<p>WRITE YOU MESSAGE HERE.</p>
</div>

Clint side script

api.controller=function() {
/* widget controller */
var c = this;
c.showAlert = c.data.topicId == 'put topicID from your page';
};

Server side

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.topicId = $sp.getParameter("topic_id");
})();

CSS
.alert {
margin:14px;
background-color: ##fdda16;
color: black;
}

 

View solution in original post

8 REPLIES 8

Not applicable

when I try to publish, my announcement widget does not appear on the widget search. probably I am missing something on 1 step.

When I create an Announcement widget, the scope is Global (it is not allowing me on other scopes).  and I apply it to the Employee Taxonomy Topic paged on the Page Designer. What could be wrong?

Not applicable

I believe I  am missing something when I create a widget. I am not able to call it when I want to publish rich content. Can you guide me on step 1?  

bubuprasadswain
Tera Guru

Please mark as Correct for closer of the thread.
Thanks in advance.

Not applicable

Finally, I found a solution. I will leave it here for the dear developers.

I created a widget and added that widget to the taxonomy page using the page designer.

 

html

<div class="alert" ng-if="c.showAlert">
<p>WRITE YOU MESSAGE HERE.</p>
</div>

Clint side script

api.controller=function() {
/* widget controller */
var c = this;
c.showAlert = c.data.topicId == 'put topicID from your page';
};

Server side

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.topicId = $sp.getParameter("topic_id");
})();

CSS
.alert {
margin:14px;
background-color: ##fdda16;
color: black;
}