Apply branding on Knowledge Article based on User Company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2023 02:56 PM
Hello ServiceNow Community,
I am looking for the advice regarding the Knowledge Branding in ServiceNow.
My goal is to display one Knowledge Article, but displayed with different branding for different Users (depending on the Company value that is set in the User record). Suppose that by branding I mean the article header with the customer specific logo and some text.
What do you think would be the best way to achieve this?
Thank you in advance for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2023 05:22 PM
Hi
You might want to consider knowledge blocks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2023 10:38 PM
Hi @Mike50 ,
I trust you are doing great.
First, you need to create a new field on the User table to store the company branding information. You can call this field something like "Company Branding Logo" and set the data type to "Image".
Next, create a new UI Macro that will be used to display the article header with the customer specific logo and text. In this macro, you can reference the "Company Branding Logo" field on the User table to dynamically display the appropriate branding for each user.
Once you have created the UI Macro, you can add it to the "Knowledge Article Header" template. To do this, navigate to "Knowledge > Administration > Knowledge Bases" and select the appropriate knowledge base. Then, click on "Templates" and edit the "Knowledge Article Header" template.
In the template editor, add the UI Macro you created in step 2 to the appropriate location in the template. You can use the "insert macro" button to do this.
Save the template and test it out by viewing a knowledge article as different users with different company branding information.
Please find the below code for the same.
<div class="knowledge-article-header">
<img src="${gs.getUser().getValue('company_branding_logo')}" alt="Company Logo">
<h1>${knowledge.title}</h1>
<p>${knowledge.short_description}</p>
</div>
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2023 02:32 PM
thank you for your suggestion.
Unfortunately, points 3. and 4. that you described are not fully clear.
Is there any option to add UI Macro to a Knowledge Article Template? Can you please explain how to achieve this?
Thank you in advance.