Implement jQuery plugin in the Blog widget

Posted by Community Admin on 04-Aug-2018 14:12

Implement jQuery plugin in the Blog widget

All Replies

Posted by Community Admin on 15-May-2014 00:00

How do I add a jQuery plugin so that it is being used on every blog post widget that is used on the site, other than going to each page and drop in javascript widget? I know I could include the plugin on every page using .master file but that seems to be an overkill.

 Thanks

Posted by Community Admin on 15-May-2014 00:00

2 Options

1) ResourceLinks Control
www.sitefinity.com/.../how-to-include-js-and-css-resources-in-custom-sitefinity-widgets
Pros: if you have multiple blog widgets on a page (could happen) the script loads once
Cons: You can't control the script position or load order

2) JavaScriptEmbedControl (in Telerik.Sitefinity.Web.UI.PublicControls)
Pros: Easy to use, can define if it renders in Head, InPlace, BeforeBodyEndTag
Cons: Doesn't check to see if script is already loaded

In EITHER case you want to add the markup to your widget templates in the backend

This thread is closed