General developer forum

 
 
My Hero
jquery and clean theme
 

Hi,

I am developing a custom block which is to use jquery.  I followed the steps in http://docs.moodle.org/dev/jQuery, which is essentially to include the following function in block_blockname.php:

function get_required_javascript() {
  parent::get_required_javascript();

  $this->page->requires->jquery();
  $this->page->requires->jquery_plugin('ui');
  $this->page->requires->jquery_plugin('ui-css');
}

It seems to load fine when using any of the older themes (I tested Standard, Fusion, Binarius, and SkyHigh).  With those themes, Firebug shows that it loads up jquery-1.9.1.js, jquery-ui.js, and jquery-ui.css.

Howevery, when I change the theme to "Clean" (the new bootstrap-based theme), I get the following error:

Can not add jQuery plugins after starting page output!

Followed by a bunch of other line and file-specific errors.  This happens if I load the block in the frontpage or a course page.

Any ideas?  Is this a clean theme bug or am I doing something wrong?

I haven't tested it, but I wonder if it affects all bootstrap themes.

Thanks in advance,

Paul

 
Average of ratings: -
My Hero
Re: jquery and clean theme
 

I don't want to cross post, but do you think this would be more appropriate for the "themes" forum?

 
Average of ratings: -
My Hero
Re: jquery and clean theme
 

This has been moved to the themes forum (https://moodle.org/mod/forum/discuss.php?d=236254).  Perhaps a moderator can remove it from this forum.

Thanks,

Paul

 
Average of ratings: -