Hi team,
I need to load some assets in Concrete as I am trying to avoid placing them in the header.php file in the theme I use and also need to conditionally load these assets when a visitor is on a specific page.
I registered the assets in application/bootstrap/app.php
and this is the following code for it:
$sa = \Concrete\Core\Asset\AssetList::getInstance();
$sa->register('css', 'survey-core', 'https://unpkg.com/survey-core/defaultV2.min.css', array('position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => false));
$sa->register('javascript', 'survey-core', 'https://unpkg.com/survey-core/survey.core.min.js', array('position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => false));
$sa->register('javascript', 'survey-js-ui', 'https://unpkg.com/survey-js-ui/survey-js-ui.min.js', array('position' => Asset::ASSET_POSITION_FOOTER, 'minify' => true, 'combine' => false));
I went ahead to group the asset together and called it where I needed it, but for some unknown reason, it doesn’t load properly. When I checked the page source, this is what I found;
Please, any advice on this will be appreciated.