- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 10:46 AM
I should also mention, if you decide that you don't need to display the categories in lists—or do anything other than view them on the idea form—you could create a simple formatter like this:
Just keep in mind that you wouldn't be able to search or interact with the categories in any way, except for in the Idea Portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 11:20 AM - edited 09-05-2024 11:20 AM
"or do anything other than view them on the idea form"
If we wanted to take this approach would creating a simple formatter accurately display the selected "Item Category" on the form?
If so any advice on how to incorporate that into the form would be awesome (form builder, layout etc).
No problem if the user can not modify or interact... just displaying the correct value on the form would be a big win!
THANK YOU SO MUCH for your assistance!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 11:57 AM
Try this approach:
- Create a UI Macro named "idea_categories"
<?xml version="1.0" encoding="utf-8" ?> <j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> <!-- Get the categories --> <g2:evaluate var="jvar_categories" object="true"> var imIdeaCategory = new global.IMIdeaCategory(); var categories = imIdeaCategory.getCategoriesForIdea(current.getUniqueValue()); var categoryList = []; if (Array.isArray(categories)) { categories.forEach(function(category) { if (category.hasOwnProperty('name')) { categoryList.push(category.name); } }); } categoryList; </g2:evaluate> <!-- Display the categories --> <div class="idea-categories clearfix"> <div class="label_spacing"> <label dir="ltr" class="control-label col-xs-12 col-md-1_5 col-lg-2 col-xs-12 col-md-1_5 col-lg-2"> <span class="category-title">Categories</span> </label> </div> <div class="col-xs-10 col-md-9 col-lg-8"> <j2:forEach items="$[jvar_categories]" var="jvar_category"> <span class="category-badge">$[jvar_category]</span> </j2:forEach> </div> </div> <!-- Styles for the category buttons --> <style> .idea-categories { margin: 0 0 10px; } .category-badge{ color: #2e2e2e; background-color: #f5f5f5; padding: 5px 10px; display: inline-block; border: 1px solid #ddd; border-radius: 4px; margin-right: 5px; margin-bottom: 10px; } </style> </j:jelly> - Create a UI Formatter (the value in "Formatter" must match the name of the UI Macro)
- Add the "Categories" formatter to the Idea form (probably under "Title")
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 12:01 PM
I will give this a shot and let you know how it works!
As usual, thank you for such an awesome reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 12:42 PM
Thank you again for all of your help!
This worked exactly as you described.