Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant' integrate CoreUi in a Symfony 6 project #586

Closed
SanChrisCC opened this issue Mar 11, 2022 · 5 comments
Closed

Cant' integrate CoreUi in a Symfony 6 project #586

SanChrisCC opened this issue Mar 11, 2022 · 5 comments
Labels

Comments

@SanChrisCC
Copy link

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

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>

Error console

This is my project tree :

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 :(

@abunch
Copy link

abunch commented Apr 9, 2022

const coreui = require('./coreui-pro/dist/vendors/@coreui/coreui-pro/js/coreui.bundle.min');
global.coreui = coreui;

@SanChrisCC
Copy link
Author

Thanks @abunch for your response !
You put these lines in the app.js ?

@abunch
Copy link

abunch commented Apr 16, 2022

@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');

@abunch
Copy link

abunch commented Apr 16, 2022

..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.

@stale
Copy link

stale bot commented Apr 25, 2023

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.

@stale stale bot added the wontfix label Apr 25, 2023
@stale stale bot closed this as completed Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants