Overriding (minified) core assets (developers How-To)

Sometimes you just want to see what's going on in those minified core js files, and modify a bit of code here and there...
At least I do.

- A warning is in place here: using this how-to can seriously mess up your concrete5 install. So please don't do this on a production site and revert when you are done - and before upgrades.


So, here's the little trick I used with the core/file-manager assetgroup.

  1. register the original files (js/build/core/file-manager/...)

The /core/file-manager.js file is actually build from 3 other files: menu, search and selector.
In app.php or rather in your package controller on_start():

$al = AssetList::getInstance();
$al->register('javascript', 'core/file-manager/menu', 'js/build/core/file-manager/menu.js');
$al->register('javascript', 'core/file-manager/search', 'js/build/core/file-manager/search.js');
$al->register('javascript', 'core/file-manager/selector', 'js/build/core/file-manager/selector.js');
$al->register('css', 'core/file-manager/css', 'css/file-manager.css', array('minify' => false));

don't forget to use AssetList


2. override the group:

$al->registerGroup('core/file-manager', array(
 array('css', 'core/app'),
 // ... all the others too (see concrete/config/app.php)
 array('javascript', 'core/file-manager/menu'),
 array('javascript', 'core/file-manager/search'),
 array('javascript', 'core/file-manager/selector'),
 array('css', 'core/file-manager/css')

3. require the asset where you need it (eg. your single-page controller view())


4. edit the .js file you want to dive into

That's it, You might wanna rename your group


May 23, 2016, 5:00 PM
May 21, 2016, 4:56 PM
Mar 1, 2016, 4:42 PM
Dec 7, 2015, 4:36 PM