You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
## Overview
4
4
Alpine is a modern & flexible responsive HTML Bootstrap 5 template with customizable card listings on the category page and an excellent product display on the individual product page. It's the perfect starting point for any fashion retail website, and the template's clean and minimal design means it's easy to modify and painless to integrate with your custom Ecommerce application. And above all, it's free!

9
9
@@ -31,7 +31,7 @@ Most developers will be editing the source code and will also be running Webpack
31
31
32
32
33
33
## Quick Start
34
-
-[Download the latest release](https://github.com/PixelRocket-Shop/Alpine-html-bootstrap/archive/main.zip) OR clone the repo: `git clone https://github.com/PixelRocket-Shop/Alpine-html-bootstrap.git`
34
+
-[Download the latest release](https://github.com/PixelRocket-Shop/alpine-html-bootstrap/archive/main.zip) OR clone the repo: `git clone https://github.com/PixelRocket-Shop/alpine-html-bootstrap.git`
35
35
- Install Node.js if you don't already have it on your system.
36
36
- Open the project root in your command line.
37
37
- run `npm install` in your command line.
@@ -50,7 +50,7 @@ To keep code repetition to a minimum, we've used Handlebars.js as the templating
**Please note that this is an HTML template only. It does not connect to a database, and will not automatically work in a content management system (Wordpress etc). You will need to incorporate our code into your application.**
56
56
@@ -60,17 +60,19 @@ To keep code repetition to a minimum, we've used Handlebars.js as the templating
60
60
* Homepage slideshow (using Swiper.js)
61
61
* Built with Bootstrap 5
62
62
* Fully responsive
63
-
* Brand logo marquee component
64
-
* Homepage featured categories component (using Swiper.js)
65
-
* Instagram slideshow component (Swiper.js)
66
-
* Category listing card showing sale badge, new product badge and sold out badge
63
+
* Brand logo component
64
+
* Homepage featured products slideshow component (using Swiper.js)
65
+
* Image Hotspot component with popout product card (using Tippy.js)
66
+
* Instagram slideshow component
67
+
* Category listing card showing sale badge and discount percentage
67
68
* Custom pagination component
68
69
* Header Megamenu
69
70
* Customer review component
71
+
* Company review component
70
72
* Related products slideshow component
71
73
* Offcanvas category filter display
72
-
* Header cart drop down display
73
-
*Slidedown search bar
74
+
* Header cart offcanvas display
75
+
*Custom search overlay
74
76
75
77
76
78
## Template File structure
@@ -97,35 +99,35 @@ We use Handlebars for two main reasons: firstly, the use of Handlebars partials
97
99
### Example Handlebars Partial
98
100
Open the following file in our template: src/html/index.html.
99
101
100
-
Around line 21 you'll see the following code:
102
+
Around line 46 you'll see the following code:
101
103
```
102
-
{{> swiper/swiper-homepage-hero }}
104
+
{{> swiper/swiper-hero-slideshow }}
103
105
```
104
-
That's a Handlebars partial. That code tells Handlebars to look inside a folder called swiper (located in the partials folder) and then to find a file called swiper-homepage-hero and insert it into the index.html file when it is compiled.
106
+
That's a Handlebars partial. That code tells Handlebars to look inside a folder called swiper (located in the partials folder) and then to find a file called swiper-hero-slideshow and insert it into the index.html file when it is compiled.
105
107
106
108
There are a few important notes about our use of Handlebars partials:
107
109
108
110
* All of our partials are stored inside src/partials. Do not place partials anywhere else.
109
111
* We use .html as our partial file extension. We have also added .svg as a valid partial file extension.
110
112
* If you have folders within folders inside your partial folder, only reference the folder the partial resides in. So "partials/header/navbars/navbar.html" would be referenced as "navbars/navbar".
111
-
* Do not include the partial file extension. Note in the example above that we output "swiper-homepage-hero" and not "swiper-homepage-hero.html"
113
+
* Do not include the partial file extension. Note in the example above that we output "swiper-hero-slideshow" and not "swiper-hero-slideshow.html"
112
114
113
115
### Handlebars Loops
114
116
Let's look at how we use Handlebars to keep our code base clean. Open up the category page: src/html/category.html.
115
117
116
-
Around line 40, you will find this code:
118
+
Around line 56, you will find this code:
117
119
```
118
120
{{#if (config category-products)}}
119
-
{{#each category-products.entries}}
120
-
<div class="col-12 col-sm-6 col-lg-4">
121
+
{{#each (limit category-products.entries 4)}}
122
+
<div class="col-12 col-sm-6 col-md-4">
121
123
{{> listing-cards/listing-card this }}
122
124
</div>
123
125
{{/each}}
124
126
{{/if}}
125
127
```
126
128
And that's our loop for a category page. We're passing in JSON data to our Handlebars loop, then inside the loop we are referencing a Handlebars partial and passing it the data for each loop item:
127
129
```
128
-
{{> listing-cards/listing-card-one this }}
130
+
{{> listing-cards/listing-card this }}
129
131
```
130
132
## Template JSON Data
131
133
The Webpack Handlebars plugin that we use comes with a very handy utility that allows us to pass in JSON files as template data.
@@ -136,8 +138,8 @@ Again, if we reference our category page loop:
0 commit comments