Friday, October 7, 2011

Changing Theme with Init Hook

If you need to actually change a theme, you need to write the following in a module's init hook:

function yourmodule_init() {
global $custom_theme, $theme;

//... some logic ...

$theme = null;
$custom_theme = 'chameleon'; // 'chameleon' being the theme you want to set

}

Jquery Events not working on ajax loaded content

Use the click function for the ajax loaded content as below

$(‘.classname’).live(“click”,function(){
});