1

I created a bootstrap subtheme ouf of CDN. Modifying the CSS works, but how do I do it with the HTML? Where do I put new HTML elements? For example: I'd like to add some elements to my footer, make it background color black and have it the width of the screen (it's not by default in Bootstrap)

This is my subtheme folder:

enter image description here

  • What's in the template folder? – leymannx Feb 24 '17 at 8:07
  • What about placing blocks in the footer region? – leymannx Feb 24 '17 at 8:08
  • The template folder is empty and placing blocks seems a hassle as I don't know how to place a navigation with links and email subscription option in the footer – Vasmir Feb 24 '17 at 8:10
  • Then simply copy your base theme's template folder over, flush cache and edit the templates inside there. – leymannx Feb 24 '17 at 8:14
  • Although doing this on template level can make the page hard to maintain pretty fast. It's worth getting used to custom blocks instead. – leymannx Feb 24 '17 at 8:15
2

A sub theme inherits its templates from the base theme. When you want to edit templates for your sub theme you simply copy over the desired template from the base theme's template folder into your sub theme's template folder, flush the cache and start editing it.

And then flush the cache again.

  • Thanks. This works. Just to compliment this: If I'd like to add my custom HTML, lets say something like this snippet here: bootsnipp.com/snippets/e3QvQ - I create a html.twig file in my template folder and paste the html there, right? – Vasmir Feb 24 '17 at 8:33
  • @Vasmir - Sort of. In the bootstrap theme it's the page.html.twig you have to copy over and edit. Find the <footer> tag and alter it to your needs. – leymannx Feb 24 '17 at 8:49

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.