(Note: the full HD video is available at YouTube.)
Now that we've added a theme and given it a grid, it's time for us to continue exploring 5.7's new theme-focused features. This one is asset support.
What are Assets?
concrete/js/redactor.js concrete/css/redactor.css concrete/js/file-manager.js concrete/css/file-manager.js concrete/js/sitemap.js concrete/css/sitemap.css
and perhaps a few more files.
addHeaderItem and addFooterItem
We used to specify these with $view->addHeaderItem() and $view->addFooterItem(). Those methods still exist, but they are brittle, and littering your code with these makes it difficult to ensure the code will still work later when more or different assets are required for the same functionality.
Now, with the Asset, AssetGroup and AssetList classes found in the \Concrete\Core\Asset namespace, we can register these assets, including whether to minify or combine them on the fly, their versions and paths, and we can group them together. Requiring all of Redactor's assets on a page now requires just this line of code
from within a block controller.
In order to remove the duplicate bootstrap assets from this theme and fix conflicts that are keeping it from functioning fully, we add code to our PageTheme class to mark that these bootstrap assets are provided by the theme.