How to Programmatically Enable ThickBox Functionality in Ektron CMS 400.Net
(Ektron CMS 400.Net,Web Programming,CSS,JavaScript,AJAX)
by Jason Skowronek
on 04/09/2010
Ektron CMS 400.Net includes a proprietary version of jQuery to handle most if not all its DHTML/AJAX client-side requirements. I wanted to demonstrate how a developer could leverage the out-of-box ThickBox (lightbox, etc.) functionality that is used throughout the Ektron components. Do not include your own jQuery library (unless you are forced to). You will end up killing your site performance by loading two complete jQuery libraries.
- Make sure the Ektron version of the ThickBox library is loaded. The easiest and least conflicting way is to register the JavaScript and StyleSheet in your .CS page OnInit or OnLoad events:
// make sure we're loading the ektron thickbox script
Ektron.Cms.API.JS.RegisterJS(this, Ektron.Cms.API.JS.ManagedScript.EktronThickBoxJS);
Ektron.Cms.API.Css.RegisterCss(this, Ektron.Cms.API.Css.ManagedStyleSheet.EktronThickBoxCss);
- Tag your links with the necessary Ektron ThickBox class name:
class="ek_thickbox"
- Modify any Ektron ThickBox attributes (based on the standard ThickBox URL tags):
href="http://www.example.org?KeepThis=true&EkTB_iframe=true&height=500&width=750
- Done!
Obviously there is much more you can do to customize your interface, styles, etc. But for a quick and dirty yet functional "lights out" effect, you can't beat this.
Carry on.
Comments (2)