coreui-free-bootstrap-admin-template
coreui-free-bootstrap-admin-template copied to clipboard
Cant' integrate CoreUi in a Symfony 6 project
I'm trying to integrate the CoreUi Admin Bootstrap template in my first Symfony project.
But I have some issues. First, the sidebar doesn't work. I can't minimize it.
And I have a JS error in my console :
Action in the code :
<button class="header-toggler px-md-0 me-md-3" type="button" onclick="coreui.Sidebar.getInstance(document.querySelector('#sidebar')).toggle()">
<i class="icon icon-lg icon-2xl cil-menu"></i>
</button>
This is my project tree :
My app.js :
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/
// any CSS you import will output into a single css file (app.css in this case)
import './styles/app.scss';
// start the Stimulus application
import './bootstrap';
import '@coreui/coreui';
import '@coreui/icons';
import 'simplebar';
My app.scss :
// @import "~bootstrap/scss/bootstrap";
@import "~@coreui/coreui/scss/coreui";
@import "~@coreui/icons";
$enable-ltr: true; /* stylelint-disable-line scss/dollar-variable-default */
$enable-rtl: true; /* stylelint-disable-line scss/dollar-variable-default */
// If you want to add custom CSS you can put it here.
@import "scss/custom";
I don't really understand whats's missing :(
const coreui = require('./coreui-pro/dist/vendors/@coreui/coreui-pro/js/coreui.bundle.min');
global.coreui = coreui;
Thanks @abunch for your response ! You put these lines in the app.js ?
@SanChrisCC I did - this seemed to bootstrap most of the coreui functionality.
const coreui = require('./coreui-pro/dist/vendors/@coreui/coreui-pro/js/coreui.bundle.min');
global.coreui = coreui;
require('./coreui-pro/dist/vendors/simplebar/js/simplebar.min');
require('./coreui-pro/dist/vendors/@coreui/utils/js/coreui-utils');
..Once you build the bootstrap admin template, move the entire directory into your assets directory ex., assets/coreui-pro
then commit the whole thing (including the node_modules directory from the build) into your repo - treat it as a built asset.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.