- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2015 11:37 AM
I have a requirement that involves adding an additional field to the top section of the kb_view ui page. Currently the Article, Published and Last Modified fields are available on the page. I need to add a new field called Role, then query the Knowledge article to display the role that is listed. I have attached a screen shot. Has anyone done this before?
Solved! Go to Solution.
- Labels:
-
Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 07:30 AM
There is macro called kb_article_header u need to modifiy that but in that case u own it and in future relse u will not get Updates.So better to create a custom macro and call that in UI page.
And roles is a glide list so u might have to create a array and publish each element.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div class="kb_article_header_short_description">$[kb.short_description.getDisplayValue()]</div>
<!-- outputs an article's header info: number, publication date, modification date -->
<div class="kb_article_header_info">
<span style="font-weight:bold;">${gs.getMessage("Article")}:</span>$[SP]$[JS,HTML:kb.number]
<span style="font-weight:bold;padding-left:8px;">$[kb.published.sys_meta.label]:</span>$[SP]$[kb.published.getDisplayValue()]
<g2:evaluate var="jvar_updated_date">
var dgo = kb.sys_updated_on.getGlideObject();
var dt = new GlideDateTime(dgo);
dt.getLocalDate().getDisplayValue();
</g2:evaluate>
<span style="font-weight:bold;padding-left:8px;">${gs.getMessage("Last modified")}:</span>$[SP]$[jvar_updated_date]
<span style="font-weight:bold;padding-left:8px;">${gs.getMessage("Roles")}:</span>$[kb.roles]
</div>
</j:jelly>
Please mark ur question as marked .If it has helped u.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 07:30 AM
There is macro called kb_article_header u need to modifiy that but in that case u own it and in future relse u will not get Updates.So better to create a custom macro and call that in UI page.
And roles is a glide list so u might have to create a array and publish each element.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div class="kb_article_header_short_description">$[kb.short_description.getDisplayValue()]</div>
<!-- outputs an article's header info: number, publication date, modification date -->
<div class="kb_article_header_info">
<span style="font-weight:bold;">${gs.getMessage("Article")}:</span>$[SP]$[JS,HTML:kb.number]
<span style="font-weight:bold;padding-left:8px;">$[kb.published.sys_meta.label]:</span>$[SP]$[kb.published.getDisplayValue()]
<g2:evaluate var="jvar_updated_date">
var dgo = kb.sys_updated_on.getGlideObject();
var dt = new GlideDateTime(dgo);
dt.getLocalDate().getDisplayValue();
</g2:evaluate>
<span style="font-weight:bold;padding-left:8px;">${gs.getMessage("Last modified")}:</span>$[SP]$[jvar_updated_date]
<span style="font-weight:bold;padding-left:8px;">${gs.getMessage("Roles")}:</span>$[kb.roles]
</div>
</j:jelly>
Please mark ur question as marked .If it has helped u.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2015 07:32 AM
kb_view_custom.xml u can modify this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2015 09:36 AM
Thank you so much Ankush, this worked perfectly!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018 04:12 AM
I have a similar requirement to show affected region field value when search for knowledge on incident short description
I used below line of code in kb_article_header ui macro but no luck. Is there any other modification required in order to achieve this requirement?
<span style="font-weight:bold;padding-left:8px;">${gs.getMessage("Affected Region")}:</span>$[kb.u_affected_region.getDisplayValue()]