HTML5 Twitter Bootstrap 3.1 Magento Boilerplate Template

Overview

Magento Boilerplate

A HTML5 Twitter Bootstrap 3.1 Magento 1.8 Boilerplate Template

Read the blog post or checkout the demo for more information.


Installation

There are three ways to install this boilerplate. Composer is by far the easiest to maintain.

Composer

A prerequisite for using this method is that you have Composer installed in your system.

Begin by creating a composer.json in the root of Magento, and ensure it has the following:

{
    "repositories": [
        {
           "type": "vcs",
           "url": "https://github.com/magento-hackathon/magento-composer-installer"
        }
    ],
    "require": {
        "magento-hackathon/magento-composer-installer": "*",
        "webcomm/magento-boilerplate": "2.0.x-dev"
    },
    "extra": {
        "magento-root-dir": "./",
        "magento-deploystrategy": "copy"
    },
    "config": {
        "preferred-install": "dist"
    }
}

Finish by installing Composer dependencies and a couple of optional enhancements:

cd your-project/
composer install

# If you wish to autoload composer files
cp vendor/webcomm/magento-boilerplate/index.php .

# If you wish to automatically set *.dev domains to developer mode
cp vendor/webcomm/magento-boilerplate/.htaccess .

# If you wish to run your own theme, replace "mytheme" with the name of your theme
cp -Rf vendor/webcomm/magento-boilerplate/app/design/frontend/boilerplate app/design/frontend/mytheme
cp -Rf vendor/webcomm/magento-boilerplate/skin/frontend/boilerplate skin/frontend/mytheme

Now you should have a new folder vendor/webcomm/magento-boilerplate with our repository and new symbolic links in Magento. You can update to each new version with composer update.

Git

Firstly, clone our repo down to a folder:

git clone [email protected]:webcomm/magento-boilerplate.git your-project

Secondly, copy in a supported Magento version over the top of the reop:

wget http://www.magentocommerce.com/downloads/assets/1.8.1.0/magento-1.8.1.0.tar.gz
tar -zxvf magento-1.8.1.0.tar.gz
mv -f magento/* your-project/

You may update to each new version with git pull.

ZIP downloads

  1. Download Magento from http://www.magentocommerce.com/download.
  2. Download our repo from https://github.com/webcomm/magento-boilerplate/archive/master.zip.

Merge the folders, and you're good to go.


Developing

Developing in our boilerplate theme is rather easy. There are basically two general possibilities:

  1. Copy or rename the boilerplate theme and start editing it.
  2. Build a new "child" theme under the boilerplate package and only edit the things you need to edit.

The second approach has the advantage that updating the boilerplate theme is quite easy. You would just replace the files under boilerplate/default with the new ones and check if you need to copy some changes to the files you edited. Updating the theme with the first approach is a nightmare. The advantage of the first approach is that you can still build custom child themes like mytheme/xmas. Anyway, this is also still possible with the second approach by using Aoe_DesignFallback.

Copy / Rename the Boilerplate Theme

To begin, you should either copy our theme or rename our theme to something useful by doing:

cp -Rf app/design/frontend/boilerplate app/design/frontend/mytheme
cp -Rf skin/frontend/boilerplate skin/frontend/mytheme

Once you've copied or renamed the theme, you will need to add it to the bottom of the .gitignore file:

!/app/design/frontend/mytheme
!/skin/frontend/mytheme

From here, you'll want to install the site and enable the theme through Magento's design configuration. Firstly, install your site like any other Magento installation. There's plenty of guides out there on that. Then, visit System > Configuration > Design > Package and change the package from default to whatever you named your theme (such as mytheme).

Build a New "Child" Theme under the boilerplate Package

To begin, you should create a new folder with your new theme name (e.g. mytheme) under app/design/frontend/boilerplate/mytheme and skin/frontend/boilerplate/mytheme.

From here, you'll want to install the site and enable the theme through Magento's design configuration. Firstly, install your site like any other Magento installation. There's plenty of guides out there on that. Then, visit System > Configuration > Design and change the package from default to boilerplate. Additionally, change the translations, templates, skin, layout and default to whatever you named your theme (such as mytheme).


The process we like to stick with when developing is have our dependencies managed for us, and use a task runner to compile them into CSS / JavaScript files which are served to the user. You don't have to do this, however it's a great way to save time down the track, even if there's a bit of a learning curve to begin with.

Asset Dependency Management and Automatic Compilation

The first thing to do this is install Bower and gulp.js (both are NodeJS applications).

To install Bower dependencies (not included in the theme becuase they're simply not required for everybody), you'll need to use Bower.

cd skin/frontend/mytheme/default
bower install

Once you have gulp.js installed globally, open up your terminal and change directory into your theme and execute gulp:

cd skin/frontend/mytheme/default
npm install
gulp

That's it. From now on, your changes you make to LESS files will automatically compile into CSS, and the same with JavaScript. Refresh your page to see changes!

Adding New Bootstrap Components

This theme does not ship with all Bootstrap CSS and JavaScript. The reason is, most sites don't need all the components and therefore you're bloating a site by providing more than required. We're including only the files required to get this boilerplate theme running.

To add new Bootstrap styles, simply open up less/style.less. From there, you may directly import Bootstrap files, or your own files which in turn import Bootstrap's. For example, add the following into less/style.less:

@import "media.less"; /* Relative to less/style.less */

Then, in less/media.less:

/* In less/media.less */
@import "../bower_components/bootstrap/less/media.less"; /* Relative to less/media.less */

.media {
    /* Your custom overrides go below the call to Bootstrap's styles */
}

You may choose to import more than just Bootstrap's LESS / CSS files. Feel free to import anything this way, it's good practice.

To add new JavaScript files, open up gulpfile.js. gulp.js is seperated into a number of tasks. One of them is the js task. Inside it, you'll see a bunch of JavaScript files listed out. If you require more Bootstrap files (or indeed any JavaScript files), simply add them to the list.

// ...
.src([
    'bower_components/jquery/jquery.js',
    'bower_components/bootstrap/js/transition.js',
    'bower_components/bootstrap/js/collapse.js',
    'bower_components/bootstrap/js/carousel.js',
    'bower_components/bootstrap/js/dropdown.js',
    'bower_components/bootstrap/js/modal.js',
    // Add new files here
    'js/script.js'
])
// ...

FAQs

  1. Notify isn't working? - check you are not running gulp on a headless (command-line only) server, such as a remote webserver or Vagrant box. Windows may need modification of your gulpfile.js and package.json files to work properly.

Manual Development (No gulp.js)

Feel free to edit any of the files under dist/css and dist/js if you'd like to manually develop your site. There's no harm in doing this, if you don't want to use gulp.js in the future. Keep in mind that, if you decide to compile with gulp.js that you will lose your manual changes.


Contributing

The git repo for this project can be found at http://github.com/webcomm/magento-boilerplate, and a demo can be found at http://magentoboilerplate.webcomm.com.au.

We feel that we've done a pretty decent job at creating a great starter theme for developing up a Magento site. We chose Twitter Bootstrap 3 not because we want all sites to look like Bootstrap, we hate that too. Bootstrap creates a great foundation of reusable components which you can use to create something truly unique.

The reason Boilerplate themes exist is so you can spend less time on getting ready to start productive work by removing the repetitive first steps. We've taken care of the boring, so you may focus on the unique.

If you like our work, we're not after your money, but rather, we'd love to see a pull request, or even an issue, on your vision for how this can be improved! At the end of the day, if we can all create something truly useful to a lot of people, everybody wins and we can all go home earlier.

Comments
  • Subcategories TopMenu Disabled?

    Subcategories TopMenu Disabled?

    Did you guys disable subcategories in the topMenu or is it a real bug to be fixed?

    When i try to create a subcategory in the admin it is being rendered by magento, but it never shows either on hover or click events.

    opened by tiarly 27
  • Gulp error

    Gulp error

    Hi, Im pretty green when it comes to Gulp but im having trouble compiling the dependencies for this boilerplate. As far as im aware everything is installed correctly. gulp -v [04:13:03] CLI version 3.8.6 [04:13:03] Local version 3.8.6 bower -v 1.3.8 node -v v0.10.28 npm -v 1.3.6

    The actual error is below and happens when I try to run gulp command from the project directory.

    module.js:340 throw err; ^ Error: Cannot find module 'gulp-less' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/public_html/skin/frontend/boilerplate/default/gulpfile.js:28:18) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

    Any help is appreciated sorry if this is covered in another thread i searched but couldnt seem to find anything that helped.

    opened by azmeehan 18
  • IE8 and IE9 issue

    IE8 and IE9 issue

    I don't know anyone has same experience, but I have an issue for IE 8 and IE9. On the browserhace.com, I got layout issue on IE9 so I tested demo page (http://magentoboilerplate.webcomm.com.au/) and got same result. Header area doesn't display correctly.

    ie9

    Also, in IE8, there's no problem on layout, but dropdown doesn't work for both demo page and the site I'm developing. ie8

    Anyone can help me? Thank you

    opened by maal2 16
  • Homepage and various others working slow

    Homepage and various others working slow

    HI there,

    I've installed this successfully.. however the homepage loads extremely slow on my computer, around 30 seconds probably. As soon as I switch back to default theme the site speeds back to to normal. What could be causing this? And what do you need from me in order to diagnose this issue.

    Thanks

    opened by brandonjjon 14
  • magento-boilerplate angularjv version

    magento-boilerplate angularjv version

    Hello, are you planing to release a magento-boilerplate angularjv version? If not how can angularjv be integrated to your boilerplate theme? Regards, heather

    opened by topstarnetwork 10
  • Development Best Practice

    Development Best Practice

    First of all, thanks for your work!

    In the docs, you always recommend to copy/rename your boilerplate. This makes upgrading the boilerplate quite hard. Wouldn't it be better to keep the boilerplate/default theme and develop one's theme under boilerplate/mytheme? Then one only has to copy the local.xml and upgrading is as easy as replacing the files under boilerplate/default (and of course diffing the files that has been copied and edited). What is the reason that you do not recommend that?

    opened by sprankhub 9
  • White Page

    White Page

    I've tried to install this 6 times so far. I've literally tried everyting. I've installed it on a ubuntu 14.04 x64 server using apache, and nginx, and windows 10 x64 using xampp..

    Everytime I follow the install instructions, and the website is a white screen... What is happening..

    I'm using magento 1.9.2.3

    opened by ghost 8
  • Registered Users

    Registered Users

    Users can't log in to their account area ../customer/account/login/ when using this theme. If the theme is changed back to the default login works fine.

    opened by InTheScript 8
  • webcomm magento-boilerplate has no css style

    webcomm magento-boilerplate has no css style

    Hi,

    I installed the webcomm boilerplate on a magento 1.7 (ftp: merged into the skin, app folders) but when I choose the theme (system -> design) I get the site without any custom/bootstrap style.

    tried to find the place you are calling the file and found the file: magentoboilerplate.xml but I can see that nothing there is running (no removeitem neither addCss or addJs)

    What am I missing?

    Thanks IHAB

    opened by ihabassi 7
  • Quick Question

    Quick Question

    Hi I'm developing my own theme with TB and Compass SASS and I was wondering how you got around the issue of Bootstrap 3's dropdown menu disappearing on click due to a conflict with prototype.js?

    I found this solution on StackExchange but was wondering if you had a better solution? http://stackoverflow.com/a/28214747/1814446

    I hope you don't mind me contacting you this way and understand if you don't have time to answer.

    Thanks, Ross

    opened by rossmc 6
  • Unminimized script.js

    Unminimized script.js

    First of all, thank you for this project. It's very useful for me to start coding my own theme using bootstrap.

    In second place, is there any way to upload to the repository an unminimized version of the script.js file? I've coded an special menu with bootstrap, and I need to disable only this functionality.

    Thank you :)

    opened by mgarciadelojo 6
  • Demo site error 500

    Demo site error 500

    Hello, I was really interested in looking at the Demo for this at the link

    http://magentoboilerplate.webcomm.com.au/

    It is unfortunately down though.

    I look forward to seeing it and to taking advantage of your hard work.

    Thank you.

    opened by ghost 0
  • Gulp Watch restart needed after Gulp.task('css', function(){  -- on Error

    Gulp Watch restart needed after Gulp.task('css', function(){ -- on Error

    For some reason gulp watch exits after the gulp.task('css',function() encounters an error in the less code to be compiled into css.

    This means that gulp watch has to be continually re-started. Any idea how to stop this behaviour as it slows down workflow considerably?

    opened by moringaman 0
  • Uncaught TypeError: e.indexOf is not a function

    Uncaught TypeError: e.indexOf is not a function

    Hi! I got this console error when using your gulp workflow:

    Uncaught TypeError: e.indexOf is not a function

    It seems it is about newer versions of jQuery not supporting "load()" anymore.

    I fixed it using:

    $(window).on('load', function({ ... }))

    at

    skin/frontend/boilerplate/default/src/js/script.js (line 42)

    I hope it helps!

    opened by seviferr 0
  • Language Attribute not in html tag

    Language Attribute not in html tag

    Hi,

    the main templates does not have the lang attribute in the html tag. Instead of:

    <!DOCTYPE html>
    <html>
    

    it should be something like that

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->getLang() ?>" lang="<?php echo $this->getLang() ?>">
    

    Greetings Jan

    opened by jg-development 2
  • Not supported version of less

    Not supported version of less

    If I try to run gulpI get following error message:

          throw new Error(name + " version " + version + " is not currently supported");
          ^
    
    Error: less version 1.7.5 is not currently supported
    

    osX 10.11.6 composer 1.2.1 npm 4.0.2 bower 1.8.0

    opened by kkrieger85 1
Owner
null
Twitter Bootstrap base theme for Magento

Magento Bootstrap This is an adaption of the Twitter Bootstrap framework for the Magento Commerce system. PLEASE NOTE THIS IS A WORK IN PROGRESS Insta

Casper Valdemar Poulsen 84 Oct 31, 2022
TXP-Tweet - arc twitter - Twitter-Textpattern integration

TXP Tweet This is TXP Tweet, a collection of Textpattern plugins for Twitter integration. TXP Tweet consists of two plugins: arc_twitter (the core Tex

Andy Carter 11 Sep 20, 2021
Sample application to bookmark links, where interface build with Angular.js + Twitter Bootstrap and server powered by PHP with Slim Framework

RESTful Bookmarks PHP Slim TODO: review and update FrontEnd Sample application to bookmark links, where interface build with Angular.js + Twitter Boot

Erko Bridee 50 Dec 15, 2021
This library provides HTML5 element definitions for HTML Purifier, compliant with the WHATWG spec

HTML5 Definitions for HTML Purifier This library provides HTML5 element definitions for HTML Purifier, compliant with the WHATWG spec. It is the most

Mateusz Turcza 92 Nov 16, 2022
A project of a Login screen made in PHP/CSS3/HTML5/JS with MySQL database integration

A project of a Login screen made in PHP/CSS3/HTML5/JS with MySQL database integration. And animations made with CSS3 and JavaScript itself! ??

Marcel Leite de Farias 2 Apr 26, 2022
PaaS template based on production template using platform.sh

Shopware for Platform.sh This template builds Shopware on Platform.sh using Composer. To get started on Platform.sh, please visit https://docs.platfor

Shopware 9 Oct 12, 2022
PDF API. JSON to PDF. PDF Template Management, Visual HTML Template Editor and API to render PDFS by json data

PDF Template Management, Visual HTML Template Editor and API to render PDFS by json data PDF ENGINE VERSION: development: This is a prerelease version

Ajous Solutions 2 Dec 30, 2022
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
A htaccess boilerplate for all Magento Community installations. Features focus on speed, SEO and security.

magento-htaccess A htaccess boilerplate for all Magento Community installations. Features focus on speed, SEO and security. The file should be placed

Creare 114 Sep 18, 2022
PHPStorm Live template preferences for Magento 2 Projects

Magento 2 PHPStorm Preferences This project is intended to setup useful PHPStorm Templates for Magento 2 Projects. Disclaimer This project overrides t

Stämpfli AG 229 Jul 18, 2022
H&O Magento 2 Advanced Template Hints module

H&O Magento 2 Advanced Template Hints module Ho_Templatehints extends the default Magento template hints. Easily accessible with muscle memory ?ath=1.

Reach Digital 245 Dec 22, 2022
Extracts information about web pages, like youtube videos, twitter statuses or blog articles.

Essence is a simple PHP library to extract media information from websites, like youtube videos, twitter statuses or blog articles. If you were alread

Essence 765 Dec 30, 2022
A Twitter bot powered by Github Actions tweeing Wikidata milestones

Twitter WikidataMeter Bot I'm the code, and deployment of Twitter bot WikidataMeter. I tweet a few fun things about Wikidata as it grows. Tweets Feel

null 9 Dec 9, 2022
All in one Video Downloader - Download videos from facebook twitter youtube tiktok and 1000+ other sites .. made by Vijay Kumar

VKRdownloader Video Downloader by @TherealVKR Vijay Kumar .... Download Video From YouTube , Facebook , Twitter , Instagram , TikTok , And 1000+ Other

Vijay Kumar 35 Dec 29, 2022
An easy-to-use web interface for downloading bittorrents, videos from twitter, youtube and the likes

An easy-to-use web interface for Aria2 and youtube-dl Search for torrents within the app from mutiple BT sites Control Aria2 and manage download tasks

jiaxin huang 54 Dec 22, 2022
Get the ID using twitter username.

Find Twitter ID Get the ID using twitter username. Development instance php 8.0 Composer 2.1.14 Installation composer install Set environment variabl

Fabrizio 0 Dec 26, 2021