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.

8 Replies

  • AdamA's avatar
    AdamA
    Khoros Oracle
    15 years ago

    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
    15 years ago

    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
    14 years ago

    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?

  • JakeR's avatar
    JakeR
    Khoros Oracle
    14 years ago

    I'm sure on a technical level this can be done (but unfortunately, I am not really knowledgeable in these specific technical ways, heheh).  My understanding is that you can hide those things via CSS. 

     

    So, when the js is spit out in the Admin ActiveCast console, my understanding is that with CSS selectors you can hide parts of that output.  I'll send up the bat-signal for a Lithium CSS guru to check out this thread.  They may be able to explain the exact steps for you.

  • MoniqueL's avatar
    MoniqueL
    Lithium Alumni (Retired)
    14 years ago

    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.

  • allensmith81's avatar
    allensmith81
    Boss
    14 years ago
    Hi,

    I am trying to hide the li.ac_author and li.ac_posted divs. I am not a css guru and keep hitting brick walls.. Any suggestions on what the ocde for this should look like?
  • allensmith81's avatar
    allensmith81
    Boss
    14 years ago
    never mind looks like this does it:

    #lia-body li.ac_author {display:none;}
    #lia-body li.ac_posted {display:none;}