Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Mentor

Announcement Carousel Component

Hey guys- I am wanting to create an announcement component within our Community. Ideally it would be something we could control messages to certain audiences. So, Partners would see partner specific content, etc. I also would like for this to be editable within Admin vs studio/SDK. 

Any idea of how i would make this happen? 

7 Replies 7
Khoros Staff

Making a few assumptions, but there are a couple of ways you could accomplish this.

Assuming first that "Partners, etc" are user roles.

If you have one announcement at a time and don't care to create an historical record of announcements:

  1. Create a new custom component
  2. Create a new text key for each role (ie custom.announcement.Partner)
  3. In the component, check the user's role and display the appropriate text key within whatever mark up you design.
    ${text.format("custom.announcement."+${user_role})}
  4. Also, check to see if the text key has content so you only display the mark up if there is an announcement to display. When you have no announcement, set the text key to custom.announcement.Partner =

If you could have multiple announcements for a given role and/or you want to keep an historical record of announcements:

  1. Create a new forum for each role that will have targeted announcements. Set appropriate permissions on the forums so only the targeted roles can see content. Using a naming convention for the ids can help with future proofing (Partner-announcements)
  2. Create a new component that checks the user role and pulls X number of most recent results from the target forum using an APIv2 search and LiQL . You may also want to add a post_time constraint, so you don't display announcements that are older than, say 7 days.
  3. Loop over query results and build out display markup if any results exist.

Hopefully, this helps or gives you some better ideas!

Mentor

@SarahD Thanks for this response! It would be helpful to know if this custom announcement component require updates to be made via studio/SDK or could this be updated in Admin via custom content? 

Thanks!

We do it like this - We have a component called "custom.article-tiles-final" - We activate it inside a Custom Content component inside of Admin though, this allows us to modify it real-time without ever doing a studio push.

Within the component, we can specify which node, articles, or how the articles even display. We don't have it implemented yet, but we'll have a 'role' parameter eventually which would limit the component to only show for those with a specific role.

You'd have to build the entire component to do all the magic though of what to display using something like this.

<@component id="Custom.Article-Tiles-Final" showSubject="true" includeStyles="true" title="Learning Paths" description="Choose from our pre-determined learning paths to follow a step-by-step journey." showArticleTeaser="true" showUser="false" showText="true" start="true" characterLimit="165" showDate="false" displayAmount="5" coverPhoto="/html/assets/demo-image-4.jpg" showMoreButton="false" showLabels="false" grid="3" showViews="false" sortBy="manual_sort ASC" displayNodes="" end="true" displayArticles="1084404,1084402,1084406,1084405,1084410" showUpvotes="false" renderAmount="5" showComments="false" uniqueId="wo35522of4"/>

 

@akloepfer  as @StanGromer  noted, this will definitely work... creating a highly parameterized component and then using a CCB so you can tweak it on the fly.

Additionally, if you would like to have a custom setting added to the Settings List Editor to configure your component from admin, you can make that request through Support.

Hey Stan would you be willing to jump on a call and go more in depth explaining this solution. I believe your solution is what we are looking for.

@tavasjn24 Sure - I admittedly probably not much help, but can bring our developer along! Feel free to shoot me a PM and we'll schedule something.

Contributor

These are all great insights 😀

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.