Forum Discussion

akloepfer's avatar
akloepfer
Expert
3 years ago

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? 

 

tavasjn24  

  • Double post?

    For the longest time, I used one of the custom components in our sidebar for single, static images. In addition to using contextual content based on node, I was also able to wrap the images and text in some if statements to display different content for Partners, Customers, Employees, or guests/anon based on a role check.

    I believe the announcement carousel currently on our community is built around jQuery. The contents of the carousel are controlled via Admin as contents of a custom component. I can also wrap the items in the role check. I can't share the carousel-specific stuff with you, but I can share the role check code if you want it.

    • tavasjn24's avatar
      tavasjn24
      Guide

      So how are you pulling the custom content into a custom component. So for example I created a custom component placed it in the header. From there I am doing a role check through IF statements which is working. Now the last part is just getting it to use the custom content so we don't have to push via studio every time we want to make announcement changes. If you are aware of how to connect the custom content to a custom component let me know.

  • *I'm not a developer but happy to pull our genius in if needed

    We have an article tiles component that we're constantly refining - It does a lot, one of which is a carousel. We put it into a custom content component so anyone with custom content privilege's can easily edit it.  I've also used custom tags in the past to 'flag' what should show up in said component before, or 'feature article'.

    In this example, it's pulling in from the specified "displayNodes" - You can see it in action on our homepage -> https://community.upwork.com/   This is our V1, we're working on an enhanced V2 we're starting to test.

    Specific to your point about roles, you could build something such as this, and only (a) allow the applicable roles to see the article tiles themselves, or (b) only allow the applicable role to see the entire component.

     

    <@component id="Custom.Article-Tiles" title="Trending" renderId="clients-carousel" tileClass="up-green-dark" displayAmount="6" styleType="carousel cover" showMoreButton="false" includeStyles="false" start="true" end="true" sortBy="post_time DESC" displayNodes="Blog,ProductUpdates,CommunityAnnouncements" displayArticles="" tileBackground="https://community-static.upwork.com/Assets/others/article-tiles-test.png"/>