Forum Discussion

qinglau's avatar
qinglau
Mentor
11 years ago

Anyway to set standard twitter steam widget only displays 3 stream

Hi All,

 

I turn on the default twitter intergration in our community. Currently, the default twitter stream widget display 5 tweets with scroll bar. I would like to have 3 tweets without scroll bar.

 

I have been search around, the idea board contains an article "Twitter Customization" http://lithosphere.lithium.com/t5/customer-ideas/Twitter-Customization/idi-p/44193.

 

Appreantly, we have to make some customization by ourself.  I start to create overrride componemnt based on the standard twitter componment

 

<div id="kpn_sidebar_twitter">
     <@delegate/>
     <div id="kpn_sidebar_twitter_followus"> <span class="blog-kpnover-link">
     <img class="blog-social-link-button" alt="twitter" src="/html/assets/social_twitter.png"> 
     <a href="#" class="arrow"> 
       > Volg ons op Twitter</a></span></div>
     </div>
</div>

 

I add a custom div id to nested the standard twitter componment. Therefore, i can more handy apply my own CSS skins. I succesfully to remove scroll bar. However, I do not find a way to use CSS to tweak 5 twitter streams into 3 twitter streams. Because they have the same class like

 

div class="lia-twitter-item-list lia-component-twitter-widget-item-list">... </div>

 I have another option is to use JQuery to hide last two div. However, i prefer not to do that . Since the Javascript performance is a bit slow

 

Does anyone have better idea? Thank you.


Cheers,

Qing

 

 

 

 


28-11-2013 14-48-48.png
  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)

    Hi qinglau 

     

    If you intend to use the standard widget then I think you need to go with the clientside approach. Said that - if the standard feature do not meet your requirements then maybe you could create a custom twitter widget but it sounds like it would be an overkill approach - also considering that by doing so you would in fact de couple it from the standard integration in Lithium.

     

    Let's see if other customers are also interested in the idea you linked (btw - there is a dot at the end of the hyperlink which needs removing): voting on that one will surely raise its visibility with our product management.

     

    Many Thanks,

    • qinglau's avatar
      qinglau
      Mentor
      Hi Paolo ,

      Thank you. I tried the javascript approach which wont work. Because the standard twitter stream is based on Ajaxcall back. So the javascript can only execute once on document ready. After that , the twitter stream will back to Normal. The clientside approach, i guess you are saying "Endpoint" solution. I guess it will be nice to have an example how to these kind integration, because i think many clients are looking for fetch the information from facebook, linkedin and twitter.

      Any helps will appreciate . Thank you.

      Cheers,
      Qing
      • PaoloT's avatar
        PaoloT
        Lithium Alumni (Retired)

        Hi qinglau 

         

        If you want to fetch information from external third parties, and these are providing an API, then endpoints are definitely a good fit. See here and the surveyGizmo integration example to get an idea. Going back to your problem, have you considered listening for ajax updates as well instead of only running your code at page load?

         

        Hope this helps,