Forum Discussion

rajeevsamuel's avatar
rajeevsamuel
Contributor
14 years ago

Active Cast Questions

As we discussed here are the technical questions I have for Lithium.

 

1)      Pulling top ten latest post by Category ID – currently we can only pull by Board ID however we need to pull the top 10 latest posts by Cateogry

 

2)       Customizable Date Format – Is it possible to customize the format of the Post Time?

 

3)      Ajax Call – We will be putting the top 10 of  four categories on a single page  – Is there a JavaScript command we can call where we can specifiy a target DIV or element to populate?

 

Rajeev Samuel

Totem Brand Communications

  • MoniqueL's avatar
    MoniqueL
    Lithium Alumni (Retired)

    Hi Rajeev, and welcome to the lithosphere. To answer your questions:

     

    1) Yes you can get the the latest topics for a category. Try /restapi/vc/categories/id/support/topics/recent

    2) Yes you can customize the date format to an extent. The Date Format is a text property which by default displays MM-DD-YYYY. You can change it to display something like DD-MM-YYYY ex:  http://supportcommunity.swisscom.ch/t5/Welcome-to-the-english-help/bd-p/welcome_en or utilize the friendly dates option in the community admin.


    3) Unfortunetly Lithium doesn't have javascript support for that at this time. However, you could write a custom component and add your own javascript code to acheieve the effect you are looking for.

    • KaelaC's avatar
      KaelaC
      Lithium Alumni (Retired)

      Replace "support" in that rest call with the actual id of your categort:

      /restapi/vc/categories/id/[your id here]/topics/recent

    • rajeevsamuel's avatar
      rajeevsamuel
      Contributor

      Hmm,

      My apologies - I did not give you sufficient background.  These are Active Cast specific questions.

      Using Active Cast the following JAVASCRIPT code is generated to enable embedding of a widget.  Right now the only option for obtaining a CATEGORY feed is from the featured posts section.  I'm looking for a feed of the top 10 from all of the boards in a category.

      <script type='text/javascript' id='ACTIVECAST-FT' src='http://hdgc.stage.lithium.com/hdgc/activecast/activecast-featured-threads.js.jsp'></script>
      <script type='text/javascript'>
          LITHIUM.ActiveCast.getFeaturedThreads('Cat_Gardening', {maxNumberOfMessages: 10,lookupThreadBy: 'CATEGORY'});
      </script>


      1) Pulling top ten latest post by Category ID - currently we can only pull by Board ID however we need to pull the top 10 latest posts by Cateogry
      Please provide a sample Javascript code

      2) Customizable Date Format - Is it possible to customize the format of the Post Time?  

      Please provide a sample Javascript code

      3) Ajax Call - We will be putting the top 10 of  four categories on a single page  
       - Is there a JavaScript command we can call where we can specifiy a target DIV or element to populate? Right now whatever generated html that appears the "<script type='text/javascript' id='ACTIVECAST-FT' src='http://hdgc.stage.lithium.com/hdgc/activecast/activecast-featured-threads.js.jsp'></script>" script tag - but I would like to target it.
       
       Please provide a sample Javascript code
       
      Cheers,
      Rajeev Samuel

      Totem Brand Communications

      • KaelaC's avatar
        KaelaC
        Lithium Alumni (Retired)

        Unfortunately, Active Cast can't really be used for what you want to do.  Our Active Cast calls support a small number of simple requests and return simple, static HTML.  The main purpose of this is to easily display dynamic content on existing web sites without the customer needing to have much technical knowledge.  

         

        For a more complex, custom project like you are looking at undertaking, I would suggest using the REST API instead.  It has a much larger number of calls/options and returns plain XML with which you can do whatever you like.