Community Help Center: conditionally add class based on forum poster's organization_id (via handlebars)
답변함Hi!
Here's the feature I'm trying to develop on my company's Zendesk help center (community page[s] to be specific):
I need to conditionally add a class based on the forum poster's organization/organization_id.
For example, I thought the below code would work on the community_post_page.hbs template:
{{#is author.organization_id "xxxxxxx"}} ... {{/is}}
I'm at a loss on if this is even possible. The reason I'm trying to do this: we'd like to portray a unique border around posters of this specific organization (to distinguish them from agents and other end-users).
Your feedback is greatly appreciated!
-
Hey Dan -
I can't advise on how to do that, but does it necessarily need to be a border? Would adding badges to those users' avatars serve the purpose for you? We do have a tip on how to do that:
-
Hi Nicole,
Thank you for the swift answer! The main reason I didn't want to use JavaScript for this was because the list of users in said organization will be variable -- hence, we don't want to have to re-update the JS every time the list changes.
Edit - the method I'm currently employing (unscalable):
<div class="post {{#is author.name 'XXXXX1'}}custom-class{{/is}} {{#is author.name 'XXXXX2'}}custom-class{{/is}}">
...which essentially does do the trick -- similar to the methodology as in the 'how to add cool agent badges in communities' article -- but we want to utilize a Zendesk feature (such as organization or tag) to make this process a less manual effort. Hope that makes sense. -
Ah, that makes sense.
It's not an immediate fix for you, but I know that there is some functionality currently being worked on that would allow you to badge users based on user segment, which can be based on organization. We don't have an ETA yet, but if you can hold tight on this for a little while, we should have a solution for this native in the product before the end of the year (and hopefully sooner than that!)
-
Thanks Nicole,
I'll let my team know it's in development. For now, we'll utilize our old approach. -
Hello.
Is this feature developing?
I am looking forward to it!
댓글을 남기려면 로그인하세요.
5 댓글