THE BASICS
Wrapping a product
When making a new product, it usually helps to encase the whole thing in a div and add a class to it. This makes it easier to enact page wide changes. Infact, this whole page is wrapped in a single div, allowing me to have custom settings on any part of the code I wish without impacting the other areas of the website.
<div class="product-wrapper">
<p>all of the content</p>
</div>
Images
Images need to be coded the following way:
<img class="lazyloaded" data-src="link-of-image" src="link-of-image" alt="Description Text for Image">
The class "lazyloaded" help increase page speed. 'data-src' helps Shopify load the image quicker. 'src' is the link of the image and should be the same as 'data-src'. 'alt' is a description of the image that appears if the image fails to load, but more importantly it helps with SEO.
Here is how to upload and get the links for files.
Links
Inserting links is done the following way:
<a href="https://treadmillfactory.ca/">This is text for a link</style>
If you add target="_blank" to the link as shown below, the link will open in a new tab.
<a href="https://treadmillfactory.ca/" target="_blank">This is text for a link</style>
Intro to CSS Styles
Including a <style"> in the product is how you make the html look good. It works like this; Say you want to make the paragraphs have a size of 14px, you would input the code here:
<style>
p {
font-size: 14px;
}
</style>
This will change every paragraph on the page, including those outside of the product description area, which is bad. That's why we use classes. If you attach a class to an html element, you can call it in the style code. That way you can change the style of a specific area without affecting the rest of the page.
<style>
p.classname {
color: #f00;
}
</style>
<p class="classname">Paragraph with a class</p>
<p>Paragraph with no class</p>
</div>
Because of something in the stylesheet called BootStrap, occassionally your own css styles will be overwritten by that. To get around it, add !important to any area of your css that is being overwritten.
<style>
p.classname {
color: #f00!important;
}
</style>
<p class="classname">Paragraph not getting overwritten</p>
</div>
There are a few thousand different ways to style html, but for most of the product pages it's been done just like that.
Shipping Info and Boxify
The Steps
Adding the shipping dims
- Add the weight of the item in the shipping area, make sure the weight is in lbs.
- Access Boxify in the more actions area
- If there is only 1 box, add the dims and have the pack mode be "Pack into box".
- If more than 1 box, enable multiple parts then add the dims.
META-GURU STUFF
Making a banner
The Code
Making a banner
Navigate to collections and go into metafields
Search for or create a metafield with the following properties:
- type: Multi-line text
- namespace: sf_collection_header
- key: html_blocks_collection_block_1
(NOT html_blocks_collection_block_b)
Then insert the following code. This is the code we have for
the Exercise Bikes Collection, but you can do whatever code you'd like. Just make sure the banner edges line up with the rest of the page.
<style>
.banner-links {
display: flex;
justify-content: space-between;
margin: 2px;
max-width: 1670px;
} @media screen and (min-width: 1024px) { .banner-links {
margin: 0 auto;
}}
.banner-links a {
margin: 2px;
position: relative;
text-align: center;
width: 100%;
} @media screen and (min-width: 1024px) { .banner-links a {
font-size: 24px;
margin: 20px 10px;
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
}}
.banner-links a:hover {
transform: scale(.95);
}
.banner-links article {
overflow: hidden;
max-height: 0;
}
</style>
<div class="banner-links">
<a href="/products/assault-airbike">
<img class="lazyloaded" data-src="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/ASSAULT_Airbike-catlink.webp" src="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/ASSAULT_Airbike-catlink.webp" alt="Assault Airbike">
<article>
<h2>The Original Airbike</h2>
<h3>Free shipping in Canada</h3>
</article>
</a>
<a href="/products/matrix-u50-xur-upright-bike">
<img class="lazyloaded" data-src="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/MATRIX_XUR_console-catlink.webp" src="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/MATRIX_XUR_console-catlink.webp" alt="U50 XUR Upright Bike">
<article>
<h2>U50 XUR Upright Bike</h2>
<h3>The Ultimate in Entertainment</h3>
</article>
</a>
</div>
For the footer. the code is mostly the same, except the key is "html_blocks_collection_block_b". Here's an example of the code for that area.
Making a footer
Navigate to collections and go into metafields
Search for or create a metafield with the following properties:
- type: Multi-line text
- namespace: sf_collection_header
- key: html_blocks_collection_block_b
Then insert the following code. This is the code we have for and most other collections that have footers.
<style>
.staffBox {
max-width: 785px;
margin: 15px auto;
}
.staffBox figure {
margin: 0 auto 10px;
position: relative;
}
.staffBox figure .collectionText {
position: absolute;
bottom: 0;
left: 0;
background: #fff;
padding: 30px;
}
.bottom-content-block {
max-width: 1650px;
margin: 50px auto;
padding: 0 15px;
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 50px;
} @media screen and (max-width: 1024px) { .bottom-content-block {
grid-template-columns: 1fr;
}}
</style>
<div class="staffBox">
<figure>
<img src="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/upright-bikes.png?v=1638566736" alt="upright bikes">
<div class="collectionText">
<img src="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/upright_bikes.png?v=1638569271" alt="upright bikes">
</div>
</figure>
<p>"An Upright bike compared to a spin bike does not allow for you to stand up and pedal on the bike. You sit on a much comfier seat and can casually ride to built in various programs while getting good cardio exercise.</p>
<p>A recumbent bike has back support which allows for people who may require back support like seniors and those recovering from injury to get a good cardio workout without putting strain on the lower back.</p>
<p>The Air bike is one of the most sought-after cardio pieces for those in the CrossFit industry. These types of bikes allow for a great HITT cardio workout which is scientifically proven to provide optimal benefits for fat loss. The air bike is very unique as it allows for both upper body and lower body engagement. The Assault Air bike has been a staple in the CrossFit industry and one of our top sellers for home and commercial use." Message from our team!</p>
</div>
<div>
<div>
<h2>Upright and Recumbent Bikes</h2>
<p>Stationary Exercise Bikes usually fall into two general categories: Upright Exercise Bikes and Recumbent Exercise Bikes. Upright Bikes can also include Indoor Cycles, although their increase in popularity has caused Indoor Cycles to be considered it's own class of Exercise Bike. And with changes and innovations in the field of exercise equipment, new hybrids and types of bikes are constantly emerging. One of these newer styles of bikes that are very popular now is the <a href="/products/assault-airbike">Assault AirBike</a>.</p>
</div>
<div>
<h2>Top Models at The Treadmill Factory</h2>
<p>Aside from the <a href="/products/assault-airbike-elite">Assault AirBike</a>, we carry a lot of different options, in both Upright and Recumbent styles. We stock only reputable brands that are always on the leading edge of new developments and technologies. Starting from the Vision R10 and U10 bikes, through to the Horizon Elite bikes, and up to the True and Octane bikes, we stand behind our line of Exercise Bikes.</p>
<p>The Treadmill Factory has a <a href="/collections/cardio">Cardio Machine</a> specifically designed to suit your needs. </p>
</div>
Inserting and editing tabs
The Code
Adding and editing tabs
Navigate to product tabs area
Name the heading (ex: dimensions, specifications, warranty, instructional, etc)
Then insert the following code. Change the values depending on the product:
For Specs, Dims, and Links
<style>
.specs-banner table {
background: none;
}
.specs-banner table td:first-of-type {
width: 20%;
}
.specs-banner table td a img {
margin-left: 6px;
}
</style>
<div class="specs-banner">
<table>
<th>SHIPPING DIMENSIONS:</th>
<tr>
<td>Length:</td>
<td>35"</td>
<</tr>
<tr>
<td>Width:</td>
<td>9"</td>
</tr>
<tr>
<td>Height:</td>
<td>27"</td>
</tr>
<tr>
<td>Weight:</td>
<td>75 lbs</td>
</tr>
<tr>
<td>Link to a manual:</td>
<td><a href="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/GAMES_SYSTEM_SellSheet.pdf" target="_blank">Don't forget the outbound link icon<img src="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/external-link.svg"></td>
</tr>
</table>
</div>
For Images
<div class="warranty-banner">
<a href="/pages/ironax-warranty" target="_blank">
<img class="lazyload" data-src="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/ironax-warranty-banner.webp" src="https://cdn.shopify.com/s/files/1/0529/7687/7730/files/ironaxWarrantyBanner.webp">
</a>
</div>
Making a product full width
The Steps
Making a full width product page
- type: integer
- namespace: sf_full_width
- key: enable
- value: 1
TEMPLATES