Displaying specific topics/categories to users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2014 02:45 PM
We are looking to display specific topics/categories in the pull down list of the knowledge home page to users based on an a setting in the audience field of the knowledge form and user type in the user record. Currently we filter articles using ACL's with the combination of the audience field and user type field but we cannot control what selection of topics/categories is available for selection
- Labels:
-
Knowledge Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2014 03:53 PM
Hi Jerry,
The most straight forward (and common) way of handling this is to use a Client Script that uses the g_form.removeOption function. You could either hardcode the options available to each audience - user type in the script or perform a lookup on a table of those combinations. Obviously, this method has no server side check so you might consider adding a business rule to enforce.
Let me know if you need more details or if this doesn't sound like a viable approach as this is not the only option, just the simplest and most proven.
Kind regards,
Travis Toulson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2014 04:06 PM
I should have been more specific. The page involved is not the knowledge form itself but the knowledge home page. The display of topics and categories is managed by the UI page kb_home
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2014 06:23 PM
Sorry, that was my mistake. I misread the question. That one quite a bit more complicated. There are a couple possibilities, though none are without a good bit of risk. I am assuming that the inline template is using a GlideRecord query behind the scenes to obtain those choice list values.
You could try to create a read ACL on the sys_choice table (or more likely sys_choice.label) that filters only if the record meets your audience-user type criteria. This may or may not work depending on how choice lists are built by the system internally. But if it does work, you can easily focus that ACL to only the Knowledge Topic and Category fields AND you aren't changing something which would prevent upgrade.
Another option is to either add javascript to the kb_home ui page or replace the inline template that generates the header. Either way, you could inject code into kb_home that would modify its behavior. Of course this is generally frowned upon because you will not receive updates on that page unless you specifically take action to receive them.
The last option that I see is to copy the kb_home, modify as you see fit and use your copy instead of the OOB. Not sure if that would work or not.
Bottom line, if ACL works, its probably the best option. An easy option is not provided on this one, to my knowledge, because Topic and Category are choice lists rather than configurable records. Please let me know if there is any other assistance I can provide on this one.
Kind regards,
Travis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2014 01:53 AM
If you only need to hide topics or categories from the KB Home page, you can use a global UI Script like this:
addLoadEvent(function() {
// Hide a topic called Applications from the KB Home page
if(location.href.indexOf('/kb_home.do') != -1 && location.href.indexOf('jvar_view_topic') == -1) {
var topics = $$("table.kb_main div[dragpart=Applications]");
if(topics.length > 0)
topics[0].hide();
}
// Hide a category called Outlook (under Email topic)
if(location.href.indexOf('/kb_home.do') != -1 && location.href.indexOf('jvar_view_topic') != -1) {
var categories = $$("table.kb_main div[dragpart=Outlook]");
if(categories.length > 0)
categories[0].hide();
}
});
You will need to enhance it a bit by adding the appropriate conditions for hiding elements.
In addition to this, consider removing the corresponding options from Topic and Category dropdown lists in the advanced search options and from the Refine Results box.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/