Forum Discussion

Inactive User's avatar
Inactive User
15 years ago

Active Cast - can be customized?

Hello,

 

I have project which will use active cast (and not API) to display some threads in another microsite. Active cast save my time compare to REST API. However, there are 3 issues i am having now.

 

1. I want to make the hyperlink of the topic to be open in a new window instead to be loaded on the same page. It means i want the target uses "_blank" and not "_parent". How can i do that?

2. How can i shorten the description, by putting a [more] link?

3. How to display number of Views and Comments? I tried "ul.ac_msginfo li.ac_views {  }" but no luck.

 

971iAFAF1B0C785EF971

 

Any thoughts really appreciated.

  • Hello,

     

    There are some built in configurations for Active Cast (Latest Threads and Featured Threads) that should solve your first two issues.  To change these configurations you will need to modify the snippet of code that you injected into your web page.  Assuming you are using the Latest Threads Active Cast, the snippet of code that you will need to change looks something like this (you will need to adjust the script scr and "myBoardId" for your community):

     

    <script type="text/javascript" id="ACTIVECAST-LT" src="http://forums.companyname.com/activecast/activecast-threads.js.jsp"></script>
    <script type="text/javascript">
    	LITHIUM.ActiveCast.getLatestThreads("myBoardId", { maxNumberOfMessages:10, numSubjectWords:10, numBodyWords:20, displayNodeTitle:false, hrefTarget: '_blank'});
    </script>

     

    The second parameter of the method call LITHIUM.ActiveCast.getLatestThreads takes an object literal that may contain the following parameters:

     

    maxNumberOfMessages - Limits the number of threads returned.  If this option is not specified then the number of threads returned is set to what is normally displayed on one page.

    numSubjectWords - Limits the length of the thread subject to a specified number of words.  An ellipse will be used if the number is exceeded per message.  If the value is set to -1 all words are displayed.  If the value is set to 0 the subject is omitted.

    numBodyWords - Limits the length of the thread body to a specified number of words.  An [More] link will be used if the number is exceeded per message.  If the value is set to -1 all words are displayed.  If the value is set to 0 the body is omitted.

    displayNodeLabel - Optionally display the node label (category or board).

    displayNodeTitle - Optionally display the node title (category or board).

    hrefTarget - Sets the target attribute for the Subject, Body 'More...', and Author links in a message. Allowed values: "_self", "_blank", "_top" or "_parent". Use "_blank" to open link in a new window.

     

    We do not currently support display the number of views and comments through Active Cast.

  • AdamA's avatar
    AdamA
    Khoros Oracle

    Hello,

     

    There are some built in configurations for Active Cast (Latest Threads and Featured Threads) that should solve your first two issues.  To change these configurations you will need to modify the snippet of code that you injected into your web page.  Assuming you are using the Latest Threads Active Cast, the snippet of code that you will need to change looks something like this (you will need to adjust the script scr and "myBoardId" for your community):

     

    <script type="text/javascript" id="ACTIVECAST-LT" src="http://forums.companyname.com/activecast/activecast-threads.js.jsp"></script>
    <script type="text/javascript">
    	LITHIUM.ActiveCast.getLatestThreads("myBoardId", { maxNumberOfMessages:10, numSubjectWords:10, numBodyWords:20, displayNodeTitle:false, hrefTarget: '_blank'});
    </script>

     

    The second parameter of the method call LITHIUM.ActiveCast.getLatestThreads takes an object literal that may contain the following parameters:

     

    maxNumberOfMessages - Limits the number of threads returned.  If this option is not specified then the number of threads returned is set to what is normally displayed on one page.

    numSubjectWords - Limits the length of the thread subject to a specified number of words.  An ellipse will be used if the number is exceeded per message.  If the value is set to -1 all words are displayed.  If the value is set to 0 the subject is omitted.

    numBodyWords - Limits the length of the thread body to a specified number of words.  An [More] link will be used if the number is exceeded per message.  If the value is set to -1 all words are displayed.  If the value is set to 0 the body is omitted.

    displayNodeLabel - Optionally display the node label (category or board).

    displayNodeTitle - Optionally display the node title (category or board).

    hrefTarget - Sets the target attribute for the Subject, Body 'More...', and Author links in a message. Allowed values: "_self", "_blank", "_top" or "_parent". Use "_blank" to open link in a new window.

     

    We do not currently support display the number of views and comments through Active Cast.

    • Inactive User's avatar
      Inactive User

      Hi Adam,

       

      Sorry my bad for late responding. Anyway, your code works! I can now pop up a new window for each and every discussion thread. I'm a bit sad that it can't display the number of view and comments, however, it's alright as we have another option (REST API) so we can have 2 choices.

       

      Thanks Adam! You rock! :D

       

      Cheers

    • caryn's avatar
      caryn
      Expert

      This is great info, thanks. I'm curious to know if, for the latest topics option, there is an opportunity to suppress the user name and/or date stamp in these variables?

      • MoniqueL's avatar
        MoniqueL
        Lithium Alumni (Retired)

        You can hide these elements via css by targeting the class that wraps these items and declaring the property to be {display:none;} but the problem there is that it can sometimes lead to new layout issues that need to be addressed. If you can provide a more detailed/specific example, I may be able to provide a better solution.