Date Picker doesn't work when not logged in

Permalink
Hi There,

Could someone point me in the right direction?

I'm trying to use a datepicker on a block, works perfectly when logged in, however it doesn't when logged out - I understand why - Jquery, ccm-dialog, etc aren't being loaded..

I've looked at several other comments and tried various things.
In my controller it has:

public function on_page_view() {
   $html = Core::make('helper/html');
   $this->addHeaderItem($html->css('jquery.ui.css'));
   $this->addHeaderItem($html->css('ccm.dialog.css'));
   $this->addHeaderItem($html->javascript('jquery.ui.js'));
   $this->addHeaderItem($html->javascript('ccm.dialog.js'));
}


Still the block is not picking up the JS files in the concrete/js folder and I don't think its picking up the Css files either. I tried various tutorials on registering assets and then requiring them, etc.. Still not working..

this is the page I'm working on it:

https://www.discoverytours.co.uk/groups/...

Could anyone provide me some hints as how to go about this - it feels like such a simple thing to do, but for the life of me I can't get it to work! Thank you very much and have a great day :)

omars786
 
omars786 replied on at Permalink Best Answer Reply
omars786
Solved --

How annoying, there wasn't a clear answer anywhere, so I leave a solution here:

All I needed to put in the view() controller of the block was:

public function view(){
$this->requireAsset('jquery/ui');
}