requireAsset('javascript', 'jquery') not loading jQuery? - SOLVED

Permalink 1 user found helpful
Hello

I installed the additional block 'simple_accordion', but it doesn't work because of missing jQuery. Checking this in the console of the browser I realised too, that the core block 'image' and the additionally installed block 'automatic_email_obfuscator' request jQuery, but they don't load it neither.

As I have in my theme a custom js-file, where I need jQuery too, I read a lot in c5-documentations and forums and came up to put a file 'page_theme.php' in my theme folder 'application/themes/Kinderrat' with the following code:

<?php
namespace Application\Theme\Kinderrat;
use Concrete\Core\Page\Theme\Theme;
class PageTheme extends Theme
{
public function registerAssets()
{
$this->requireAsset('javascript', 'jquery');
}
}

Deinstalled and reinstalled my theme, activated it and it still doesn't load jQuery.

After a whole day of searches and several trials I'm hoping now for some help here. Any comment will be appreciated, thanks.

View Replies:
mnakalay replied on at Permalink Reply
mnakalay
Your code looks correct so the problem could come from elsewhere. Could you share more of your code or give an address to have a look?
dessisan replied on at Permalink Reply
I sent you a pm
mnakalay replied on at Permalink Reply
mnakalay
PM answered
dessisan replied on at Permalink Reply
With advice of mnakalay I was able to solve the problem, for which I owe him many thanks and respect.

My code in the file 'page_theme.php' was correct, but c5 couldn't find the file, because the name of my theme folder started with a capital letter: 'Kinderrat'. I deactivated and deinstalled the theme, renamed the theme-folder without capital letter, all lowercase, to 'kinderrat', reinstalled and reactivated the theme and that did the trick. Now jQuery gets loaded as expected.