path not found for block asset register
Permalink
I'm building a block implementing JCarousel.
I've got it all working. but I can't get it to function with the prefered method of accessing the .js file. That is registering it and requiring it.
I worked from the code in the documentation and generated this;
public function on_start(){
$al = \Concrete\Core\Asset\AssetList::getInstance();
$al->register('javascript', 'trrjcarousel', 'blocks/trr_jcarousel/jquery.jcarousel.min.js');
}
the path is right and should work from the docs but it fails to locate the file. Giving a error indicating it was looking under concrete sitename/concrete/blocks/trr_jcarousel/jquery.jcarousel.min.js
I have it working by renaming the file view.js to auto load it but of course that's not how it should be done.
any ideas why the path doesn't work?
I've got it all working. but I can't get it to function with the prefered method of accessing the .js file. That is registering it and requiring it.
I worked from the code in the documentation and generated this;
public function on_start(){
$al = \Concrete\Core\Asset\AssetList::getInstance();
$al->register('javascript', 'trrjcarousel', 'blocks/trr_jcarousel/jquery.jcarousel.min.js');
}
the path is right and should work from the docs but it fails to locate the file. Giving a error indicating it was looking under concrete sitename/concrete/blocks/trr_jcarousel/jquery.jcarousel.min.js
I have it working by renaming the file view.js to auto load it but of course that's not how it should be done.
any ideas why the path doesn't work?
you have to do it like that:
Cheers,
marc