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

Suggest installing Bootstrap assets via composer #402

Open
mehov opened this issue Nov 11, 2024 · 2 comments
Open

Suggest installing Bootstrap assets via composer #402

mehov opened this issue Nov 11, 2024 · 2 comments

Comments

@mehov
Copy link

mehov commented Nov 11, 2024

FriendsOfCake/bootstrap-ui does not come with Bootstrap itself, so we need to install the whole thing separately.

Right now the recommended way to do that seems to be via npm, either using bin/cake bootstrap install or manually:

Consider recommending getting Bootstrap from composer. I think that's much faster, more native to PHP and does not require npm to be available.

composer require twbs/bootstrap:5.3.3
composer require twbs/bootstrap-icons

(I had to install twbs/bootstrap-icons separately because twbs/bootstrap doesn't seem to contain the font directory.)

Link your application webroot to where Bootstrap files are actually located:

mkdir ./webroot/bootstrap_u_i
ln -s ../../vendor/twbs/bootstrap/dist/css ./webroot/bootstrap_u_i/css
ln -s ../../vendor/twbs/bootstrap/dist/js ./webroot/bootstrap_u_i/js
ln -s ../../vendor/twbs/bootstrap-icons/font ./webroot/bootstrap_u_i/font

The default FriendsOfCake/bootstrap-ui layout expects the files to be available under /bootstrap_u_i, so by symlinking the path like that, it picks almost everything up right away automatically.

@mehov
Copy link
Author

mehov commented Nov 11, 2024

Only /bootstrap_u_i/js/popper.js didn't get picked up automatically because it never gets compiled like I assume it would under npm.

@umer936
Copy link
Contributor

umer936 commented Nov 12, 2024

I would prefer to have Bootstrap included using composer instead of npm as well.

The ./webroot/bootstrap_u_i folder should be created by bin/cake plugin assets symlink, but maybe the other symlinks could be done in the InstallCommand.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants