1

Adding the direct bootstrap online link conflicts with the layout. I've compiled bootstrap for just the responsive grid, but cannot find exactly where to place this bootstrap.min.css and how to link it from my homepage. All i want is the responsive grid. I'm running a child theme off Luma.

Magento version 2.0.13

1 Answer 1

3

You can include it in CMS home page as follows.

app/design/frontend/Vendor/theme/Magento_Cms/layout/cms_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/framework/Module/etc/module.xsd">
  <head>
    <css src="css/bootstrap.min.css" />
  </head>
</page>

Put bootstrap.min.css in app/design/frontend/Vendor/theme/web/css/

At last deploy static content as follows.

php bin/magento setup:static-content:deploy
5
  • ok, did that and got the following message: [InvalidArgumentException] There are no commands defined in the "setup:static-content" namespace.
    – monk
    May 6, 2017 at 20:43
  • Please give permission to var folder. chmod 777 -R var May 6, 2017 at 20:47
  • and then try to deploy content again May 6, 2017 at 20:48
  • How to add bootstrap js?
    – Magecode
    May 30, 2018 at 10:36
  • You can add it using require config js file May 30, 2018 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.