adding 3rd party jquery plugin to content

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/7/2009 12:08:15 PM
Gravatar
Total Posts 20

adding 3rd party jquery plugin to content

Joe:

I am attempting to add a jquery plugin to the content to a page on a test site.  Your built-in functions work fine obviously, where as the jquery.mbContainersPlus has the following error:

Error: $(".containerPlus").buildContainers is not a function
Source File: http://www.greenthumbmarketingservices.com/jquerytest.aspx
Line: 249

The static html page works fine: www.greenthumbmarketingservices.com/demo.html

I added the minimal js call to the bottom of the layout.Master page and dependent js files to head.  I placed the mbContainer.css file in the skin folder and added the name to style.config.  Also, added some demo divs to content.

I must be missing something obvious... but my pooh-bear size brain can't figure it out ;-\

By the way, MP is unfolding like a flower in the Spring. Nominated it on CMS Award 09.  Hope you successfully move to a profit business model soon.

Paul

 

8/7/2009 12:19:17 PM
Gravatar
Total Posts 18439

Re: adding 3rd party jquery plugin to content

It can be complicated getting jquery plugins working. I think the biggest issue is that your plugin scripts are loaded before the main jquery scripts and they need to come in after.

I would create a custom usercontrol and put it in the layout.master just inside the <form>

Inside the UserControl you can add the plugin script using something like this from code but changing the path and the key to reflect your scripts.

Page.ClientScript.RegisterClientScriptBlock(typeof(Page),
"custompluginname", "\n<script src=\""
+ Page.ResolveUrl("~/ClientScript/pathtoyour.js") + "\" type=\"text/javascript\" ></script>");

This should make it load your scripts below the main jquery scripts.

Hope it helps,

Joe

8/7/2009 12:52:25 PM
Gravatar
Total Posts 20

Re: adding 3rd party jquery plugin to content

Joe:
Thanks for the quick reply!  I'll try your suggestions this weekend.  I appreciate your expertise!

Paul

You must sign in to post in the forums. This thread is closed to new posts.