Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Bootstrap Site Blueprints Volume II
Bootstrap Site Blueprints Volume II

Bootstrap Site Blueprints Volume II: Maximize the potential of Bootstrap for faster and more responsive web applications

eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Bootstrap Site Blueprints Volume II

Chapter 2. Building a Restaurant Website

In the previous chapter, we laid down the foundation that will be used in all our blueprints moving forward. In the second chapter, we'll use our Harp.js development environment and build an actual restaurant website. This will include building more page templates, introducing Google Web Fonts, customizing Bootstrap components, and much more. But before we jump right into it by expanding on the files we set up in the first chapter, let's preview the home page for our new restaurant website:

Building a Restaurant Website

Building our development environment

In the first chapter, we kept our Harp.js development environment pretty basic. We did this because we want to be able to use it as a boilerplate for all our projects. The first thing that we need to do in this chapter is expand on our original work to customize and extend it for our restaurant website.

Adding more pages

Now, the first thing we should do is update _data.json with all the new pages that we'll be building for our restaurant website. Along with our home page, let's add three new pages: Menu, About, and Contact. Our file should look like this:

{
  "index": {
    "pageTitle": "Home"
  },
  "menu": {
    "pageTitle": "Menu"
  },
  "about": {
    "pageTitle": "About"
  },
  "contact": {
    "pageTitle": "Contact"
  }
}

As you can see, I've added three new sections to our JSON file. Make sure you name your files...

Home page

The home page for the restaurant website will be split into four main parts: a primary image banner, an "about the restaurant" statement, a few food thumbnails that will link to our menu page, and a Bootstrap reviews carousel. Here's what the page that we'll be creating will look like:

Home page

Adding the primary header image

We're going to set up some reusable styles for this image banner, which will be present across multiple pages of the website. Here's the code for the home page banner:

<div class="public-banner">
    <div class="row">
      <div class="col-lg-12">
        <img src="img/banner.jpg" width="1170" height="500" alt="Public Restaurant Banner">
      </div>
    </div>
  </div>

The primary image for the design will stretch the entire width of the layout. The problem is that Bootstrap provides some padding here by default. Using the .public...

The About page

The next page for our restaurant website is the About page. This page will feature a two-column layout and some custom text styles to give it a unique look. Here's a screenshot of what we'll be building:

The About page

Changing the feature image

The first thing that we need to do is create a new file called about.ejs. Next, we'll change the feature image as displayed in the preceding screenshot. To do this, we'll simply update this image line of code:

<img src="img/banner-about.jpg" width="1170" height="500" alt="Public Restaurant About Banner">

Make sure you update the alt text to optimize your image for search results. The next thing we need to do is set up our two-column layout. I'm going to wrap a <div> with a class of .page-body around the row, as we've done in the past:

<div class="page-body">

This will allow us to apply some padding around our main page body:

.page-body {
  padding: (@padding...

The Menu page

It's time to code the tastiest part of our restaurant website (sorry, that was a terrible pun). For our menu page, we'll use a three-column layout combined with some additional modal popups for our featured dishes. The following is a preview of what the page will look like:

The Menu page

As you can see, I've kept the layout pretty minimal, which is my style and will transfer well to the mobile view. Let's start by going over the page header style that is used for each section of the menu.

Customizing the .page-header class

For each section of the menu, I'm using a <h2> tag with the Bootstrap .page-header class to make it stand out. Here's what the code looks like:

<h2 class="page-header">Appetizers</h2>

Since we don't want our site to look like a generic Bootstrap project, I'm going to customize the look and feel of the page-header component:

.page-header {
  padding-bottom: (@padding * 1.5);
  margin: @margin 0;
  border-bottom...

The Contact page

We're down to the final page of our restaurant website. The last thing do is set up our Contact page, which will include an actual Google map along with some required content that all restaurants should ideally list on their website. Here's what the Contact page will look like once we're done:

The Contact page

Inserting the Google Map

If you haven't done this before, you should note that Google actually makes it quite easy to generate maps that you can insert into your website. First, let's head over to http://google.com/maps. Once it loads up, enter the address of your restaurant. I don't have an actual restaurant, so I'm just using Vancouver as my search term. After the map is generated, there will be a little Settings gear icon near the bottom-right corner of the window. Click on this icon and you'll see a pop-up menu. Choose the Share or Embed Map option from the menu.

Clicking on this link will launch a modal. Make sure you click on the second tab...

Building our development environment


In the first chapter, we kept our Harp.js development environment pretty basic. We did this because we want to be able to use it as a boilerplate for all our projects. The first thing that we need to do in this chapter is expand on our original work to customize and extend it for our restaurant website.

Adding more pages

Now, the first thing we should do is update _data.json with all the new pages that we'll be building for our restaurant website. Along with our home page, let's add three new pages: Menu, About, and Contact. Our file should look like this:

{
  "index": {
    "pageTitle": "Home"
  },
  "menu": {
    "pageTitle": "Menu"
  },
  "about": {
    "pageTitle": "About"
  },
  "contact": {
    "pageTitle": "Contact"
  }
}

As you can see, I've added three new sections to our JSON file. Make sure you name your files to match the first part. Then, I've defined a pageTitle value for each page. Save the file and close it.

Note

The _harp.json doesn't require...

Left arrow icon Right arrow icon

Key benefits

  • Build Bootstrap projects quickly and easily with Harp.js, Node, and Less
  • Learn how to extend Bootstrap with the use of open source JavaScript and icon web font libraries
  • Get acquainted with building complex social networking, wiki, and dashboard projects with Bootstrap

Description

Bootstrap is the most popular open source project on GitHub today. With a little bit of know-how, this massively popular CSS framework can leveraged for any type of complex web application or website. Bootstrap Site Blueprints Volume II will teach you to build these types of projects in an easy-to-understand fashion. The key to any complex Bootstrap project is a strong development foundation for your project. The book will first teach you how to build a Bootstrap development environment using Harp.js, Node, and Less. In the next chapters, we’ll build on this foundation by creating restaurant and mobile-first aggregator projects. Once you’re warmed up, we’ll move on to more complex projects such as a wiki, a new magazine, a dashboard, and finally a social networking website. Whether you are brand new to Bootstrap or a seasoned expert, this book will provide you with the skills you need to successfully create a number of popular web applications and websites.

Who is this book for?

Bootstrap Site Blueprints Volume II is geared for developers of all experience levels. It is written in a concise, easy-to-understand way. Each project follows a step-by-step process that anyone can understand. Some experience with Bootstrap beforehand would definitely be an asset but is not required.

What you will learn

  • Customize and extend existing Bootstrap JavaScript components
  • Combine the Google Material Design look and feel with Bootstrap
  • Use flexbox and other cutting-edge CSS3 techniques in Bootstrap
  • Implement and customize open source JavaScript chart libraries in Bootstrap
  • Optimize and implement an optimal user experience for all your projects
  • Implement the Disqus commenting platform into your projects

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 06, 2016
Length: 328 pages
Edition : 1st
Language : English
ISBN-13 : 9781785284915
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jan 06, 2016
Length: 328 pages
Edition : 1st
Language : English
ISBN-13 : 9781785284915
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 152.97
Bootstrap Site Blueprints
$48.99
Bootstrap 4 By Example
$48.99
Bootstrap Site Blueprints Volume II
$54.99
Total $ 152.97 Stars icon

Table of Contents

8 Chapters
1. Advanced Bootstrap Development Tools Chevron down icon Chevron up icon
2. Building a Restaurant Website Chevron down icon Chevron up icon
3. Mobile First Bootstrap Chevron down icon Chevron up icon
4. Bootstrap Wiki Chevron down icon Chevron up icon
5. Bootstrap News Magazine Chevron down icon Chevron up icon
6. Bootstrap Dashboard Chevron down icon Chevron up icon
7. Bootstrap Social Network Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(2 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Lisa Nov 04, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is great for developers who have some knowledge of HTML, CSS, Bootstrap and want to get to the next level. It is very easy to follow and references other great developer tools.
Amazon Verified review Amazon
Svein Soermo Apr 12, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
High quality projects and very good explanations.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.