I am pulling my hair out here trying to make sense of how on earth I’m supposed to use assets I register in my somehow esoteric scenario (which shouldn’t be an esoteric scenario).
I have my package where I have multiple templates for core blocks (express_entry_list & express_entry_detail).
I am trying to register wow.js & animate.css in such a way that I can invoke them when either of these blocks are used.
From what I can tell, I have to use a controller.php at the package/blocks/express_entry_list/controller.php level (replacing express_entry_list with express_entry_detail for that block), and not within each template. Okay fine, except I cannot for the life of me get this damned controller.php to actually EXECUTE.
In my test environment all caching is off (Dashboard settings).
I have tried registering the assets in either packageroot/controller.php (in the on_start() function), and/or in the package/blocks/express_entry_list/controller.php file (in the on_start() function, and/or the registerViewAssets() function), and I cannot tell if the registration happens, but when I try to also require the asset(s) the diagnostic (F12) console doesn’t show ANY of the files being loaded (using $this->requireAsset(‘whatever’); in either the controller.php for the block, as described above in either on_start() or the regisaterViewAssets() function)
I CANNOT for the life of me figure out why my controller.php for a core block is not loading (so far as I can tell). I do not want to change the core functionality of these blocks, I just want to template them, and load js + css assets in the “asset registration” method, which is supposed to be the way to go, to reduce duplication, etc, but my scenario is somehow insufficiently documented and not enough examples exist.
Before I start posting any example code, I want to understand what the method I SHOULD be using in this scenario is? Every single controller.php override example I see talks about putting them in application/blocks/blockname/controller.php and not about usage in packages, in this scenario. Also, because I’ve gone through so many iterations, I can’t exactly accurately (while being not-overly-verbose) represent what code I have tried.
So… this should as hell be easier than it seems to be. And I have even gone so far as to verify that the filesystem permissions are correctly set for both controller.php files!
ARGH I’m losing hair here! Can I please get help? I seriously feel like I’m doing something basic and wrong, but I cannot find what after exhaustive research.