Forum Discussion

jpierlot's avatar
7 years ago
Solved

How to use community.widget.active-cast-featured-topics

Hello,

I want to use the component community.widget.active-cast-featured-topics on the homepage of my community which is a category page. 

When I go in admin > content > activecast > featured topics, I can then choose my category, the number of topics I want etc. and the admin generates a script like this one : 

<script type="text/javascript" id="lia-ac-ft-english" src="https://XXXXX.stage.lithium.com/t5/activecast/featuredthreadspage?activecast.parent_element_id=lia-ac-ft-english&activecast.sort_direction=descending&profile.language=en"></script>
<script type="text/javascript">
LITHIUM.ActiveCast.getFeaturedThreads('english', {
"parentElementId" : "lia-ac-ft-english",
"numSubjectWords" : 100,
"lookupThreadBy" : "CATEGORY",
"displayNodeTitle" : true,
"maxNumberOfMessages" : 5,
"numBodyWords" : 100,
"displayNodeLabel" : true
});
</script>

I have 2 problems with this component :

 1. When I go to the Studio and add the component community.widget.active-cast-featured-topics on my category page, I have an error message which is displayed. 

2. I don't know where to put this script so that I can use it in a component on my homepage. 

Would anybody know anything about this  component to help me please? Thanks a lot. 

Julien. 

  • jpierlot - You have to create a new custom component(Go to Studio -> Component -> New Component) and then add the activeCast script there. Now, include this component to the Category Page.

    Hope this helps.

    Thanks,

    Payal

  • Payal's avatar
    Payal
    7 years ago

    matthieul - Have you set the permission for "Make REST API calls with read access" to Grant? This permission is also required to access the content externally.

    After these settings, generate the script and then try.

    Thanks,

    Payal

6 Replies

  • jpierlot - You have to create a new custom component(Go to Studio -> Component -> New Component) and then add the activeCast script there. Now, include this component to the Category Page.

    Hope this helps.

    Thanks,

    Payal

  • jpierlot's avatar
    jpierlot
    Guide
    7 years ago

    Hi Payal. Your solution works. Nevertheless, it is only displayed when I am connected in to the Community. Would you have a solution for me to display the script for unregistered users as well ?

    Thanks for your help. 

    Julien. 

     

  • Hi Payal, I'm working with jpierlot.

    We have already enable "Content Security Policy for ActiveCast" and we have * to allowed all domain.

    there must be an other reason when the user is not connected.

  • Payal's avatar
    Payal
    Director
    7 years ago

    matthieul - Have you set the permission for "Make REST API calls with read access" to Grant? This permission is also required to access the content externally.

    After these settings, generate the script and then try.

    Thanks,

    Payal

  • Payal it's working, thanks.

    Admin -> User -> Permission

    I activated : Make REST API calls with read access 
     

    THanks