jquery-ui.css not included when not logged in

Permalink 1 user found helpful
Hello,

I'm using concrete 5.7.5.6 and I'm trying to add a jQuery UI accordion in a page template.

The jquery-ui.js version already included in c5 located in concrete/js doesn't include the accordion. So I've downloaded a jquery-ui.js version with the accordion and copy it to application/js.

I've then added:

$this->requireAsset('javascript','jquery/ui');


in my header_top.php. (My theme is based on the elemental theme)

When I'm logged in everything is working fine but when I'm not logged in the jquery-ui.css is not included in the generated page and the accordion is not correctly styled.

Any suggestion on this?

 
VonUniGE replied on at Permalink Reply
I was wrongly thinking that
$this->requireAsset('javascript','jquery/ui');

will include all required dependencies, but it's not the case you have to manually include the css with:
$this->requireAsset('css','jquery/ui');


Or maybe it's a c5 bug?
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi VonUniGE,

jQuery UI is available as an asset group (CSS and JavaScript), individual CSS asset, and individual JavaScript asset.

asset group:
$this->requireAsset('jquery/ui');

CSS:
$this->requireAsset(css', 'jquery/ui');

JavaScript
$this->requireAsset('javascript', 'jquery/ui');

http://documentation.concrete5.org/developers/appendix/asset-list...
VonUniGE replied on at Permalink Reply
I didnt't know this distinction. Thank you very much.
siton replied on at Permalink Reply
siton
Hey vonunige,

Please mark as "best answer" for future google searches about this topic.

Thanks :)