Jquery and 5.7.4

Permalink 1 user found helpful
Hey All - I'm confused, does concrete no longer supply jquery to a site? I started building a theme that required a few jquery tricks and upon signing out, I see jquery is missing.

1) Do I now have to provide jquery manually for my theme?
2) What is the best way to do this? Asset Registration is sincerely confusing for me - can I not use the jquery file that is shipped with concrete?

juddc
 
jordif replied on at Permalink Reply
jordif
Hi,

yes, you can use the jquery file that is shipped with concrete5, you only need to add the following code to your page_theme.php file:

public function registerAssets()
{
    $this->requireAsset('javascript', 'jquery');
}


I understand it can be confusing at first, but actually Asset Registration is very helpful once you get used to it.

I think this page in the documentation might be of help (it also shows how to include the jquery file that comes with the core without using Asset Registation, though I'd recommend you to give it a try):

http://www.concrete5.org/documentation/developers/5.7/designing-for...


Jordi
juddc replied on at Permalink Reply
juddc
Thanks - I started figuring it out - lots of changes...
caomicc replied on at Permalink Reply
I also had this issue, what I ended up doing was taking my page_theme file and adding

public function registerAssets()
{
    $this->requireAsset('css', 'font-awesome');
    $this->providesAsset('javascript', 'jquery');
    $this->providesAsset('javascript', 'jquery.ui');
    $this->providesAsset('javascript', 'bootstrap/*');
    $this->providesAsset('css', 'bootstrap/*');
}
   }

Just because I also needed jQuery UI