Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > jQuery Tweet! and scrolling news View modes: 
User avatar
Member
Member
dhyatt-visitseattle - 12/5/2010 10:42:33 PM
   
jQuery Tweet! and scrolling news
Alright, I need some help. I am using a scrolling news widget on a page. It works great. I want to add the jQuery Tweet! plugin (which I have used in other Kentico sites magnificently, but WITHOUT the scrolling news).

When I add the jQuery reference into the head of my master page, my Tweet! plugin works great, but my scrolling news stops working.

I have tried to utilize CMS.GlobalHelpers.ScriptHelper.RegisterJQuery() method, but the result is the same.

Here is the markup in the master page head:

<link href="~/CMSPages/GetCSS.aspx?stylesheetname=CorporateSitePrinter" type="text/css" rel="stylesheet" media="print" />
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></script>
<link rel="Stylesheet" href="App_Themes/CorporateSiteGrayBlue/jquery.tweet.css" />
<script language="javascript" src="http://www.MyUrl.com/jquery.tweet.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".tweet").tweet({
username: "MyTwitterUsername",
join_text: "auto",
avatar_size: 32,
count: 10,
auto_join_text_default: "we said,",
auto_join_text_ed: "we",
auto_join_text_ing: "we were",
auto_join_text_reply: "we replied to",
auto_join_text_url: "we were checking out",
loading_text: "loading tweets..."
});
});
</script>

Simply removing the following line of markup restores the scrolling news functionality:

<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></script>

Suggestions on how I can have both of these widgets functioning on the same page? Thank you in advance!

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 12/13/2010 6:21:48 PM
   
RE:jQuery Tweet! and scrolling news
Hi,

Hope any advice will be still useful...

The problem is in usage of $ function for jQuery, which is being overriden by MooTools used in Scrolling news.
Also the used google jQuery doesn't have noConflict() ...

That means you'll have to link our jQuery script (like you've already tried - CMS.GlobalHelper.ScriptHelper.RegisterJQuery()) and use jQuery() calls instead of $() in your Tweet! script.


Hope this helps,

Regards,
Zdenek