- Custom Template Tutorial
Tutorial: Basic Auction Template
First things first...
  • Custom created auction templates are intended for advanced users. You do not need to design and store your own auction template to use the BiggerBids system. We have many "stock" templates that our members can choose among.
  • Before you try to design an auction template, you should first be familiar with how the BiggerBids system works and what information you are able to store for each auction. We offer a free account that will allow you to "play" with the system. You can sign up here.
  • Make sure you have printed out and are familiar with the variables available in all templates and the Smarty documentation.
  • You can view the template we are about to create within our testing tool by clicking this link.
What are the goals of this tutorial?
OK, we're not about to create an award winning auction template design here. The main goal of this tutorial is to simply familiarize you with the way these templates behave and provide a general framework for creating your own designs. You do not have to follow the overall design structure we are using here. Your own creativity is all that limits you.
On with the tutorial...
We are going to layout this auction template in the following order:
  1. Main Image
  2. Auction Title
  3. All remaining images
  4. Item description
  5. Shipping details
  6. Payment details
  7. Additional information
  8. Seller's policies
  9. Seller's business description
  10. Seller's inter-eBay links
  11. Cross-promote seller's eBay store
Then we'll go back and make a couple overall changes:
  1. Wrap it all up
  2. Add some style

Other than the auction's title (#2 above) all information in optional. Therefore, we need to make sure we include conditional statements where necessary. The two main conditional statements we'll use here are the "if" statement and the "foreach" statement. Please refer to your Smarty documentation for details about each.

For ease of reading, I am going to first organize the coded content and then go back and apply a style to it using cascading styles. Keep in mind that most auction sites do not allow off-site linking (e.g. linking to an external style sheet) so we will need to ensure all elements of our template are contained within one file (or block of code). Also, because our designs will most likely be included within the middle section of other web pages, we want to (1) ensure that our CSS class names will be unique to any page and (2) ensure we make no use of absolute positioning.

1. Main Image
A seller can store up to 12 images for each auction they create. However, they can assign one of those images as the auction's "main image." The main image is the first image in our block of 12. Let's display it prominently at the top of the auction. We will make it a clickable image with maximum dimensions of 600 x 600 pixels.
<!-- Search for, and display our main image -->
<div class="BbImageMain">
  {if $IMAGES.1}
    {$IMAGES.1->getThumbWithLink(600, 600)}
  {/if}
</div>
Notice how we used an "if" statement to first determine if the seller had the first (or "main") image stored.
2. Auction title
The auction title is the only piece of information that the seller is required to store for any auction. Let's display it directly underneath the main image.
<!-- Auction title is required, let's display it -->
<div class="BbAuctionTitle">
{$AUCTION_TITLE}
</div>postdesc
3. All remaining images
This is one of the most highly configurable sections the designer has to work with. Notice how we loop through each image and display a clickable thumbnail that has maximum dimensions of 90 pixels wide by 90 pixels high. We also tell the system that we want 2 pixels of horizontal spacing and 2 pixels of vertical spacing on each thumbnail.
<!-- Loop over and display all other images as clickable thumbnails -->
Click any image to see it larger...
<div class="BbThumbnails">
{foreach item=image from=$IMAGES}
{$image->getThumbWithLink(90, 90, 2, 2)}
{/foreach}
</div>
With the above piece of code we will actually redisplay the main image. It is possible to skip the main image if you feel it's best. I'll let you read through your Smarty documentation to discover how this is easily done.
4. Item Description
To conserve some style sheeting, I have assigned the same style class to the next 4 pieces of our puzzle. Each one uses an "if" conditional to determine whether or not to display the content.
<!-- Description of the item being sold -->
{if $AUCTION_DESCRIPTION}
<div class="BbMainInfoBlock">
<b>Item Description</b>
<hr>
{$AUCTION_DESCRIPTION}
</div>
{/if}
5. Shipping details
<!-- How the item will be shipped -->
{if $AUCTION_SHIPPING}
<div class="BbMainInfoBlock">
<b>Shipping Details</b>
<hr>
{$AUCTION_SHIPPING}
</div>
{/if} code
6. Payment details
<!-- How the item must be paid for -->
{if $AUCTION_PAYMENT}
<div class="BbMainInfoBlock">
<b>Payment Details</b>
<hr>
{$AUCTION_PAYMENT}
</div>
{/if}
7. Additional Information
<!-- Display any additional information -->
{if $AUCTION_ADD_INF}
<div class="BbMainInfoBlock">
<b>Additional Information</b>
<hr>
{$AUCTION_ADD_INF}
</div>
{/if}
8. Seller's Policies
A seller can define up to 5 individual selling policies. These are simply blocks of text that are accompanied by a heading. Here, I loop over and display each policy and its heading.
<!--
Loop over each selling policy that has
been configured and display the details
-->
{foreach item=policy from=$POLICIES}
<div class="BbPolicyTitle">{$policy.heading}</div>
<div class="BbPolicyDescription">{$policy.details}</div>
{/foreach}
9. Seller's Business Description
Sellers can store their logo and a description of their business. Some sellers store one or the other or both. That's why we see the OR (||) conditional within the "if" conditional. This means that if either exits, we want to render this section.
<!-- Display info about the seller's business -->
{if $BUSINESS_LOGO_URL || $BUSINESS_DESCRIPTION}
<div class="BbBusiness">
<hr>
{if $BUSINESS_LOGO_URL}
<img src="{$BUSINESS_LOGO_URL}" hspace="5" align="left">
{/if}
{if $BUSINESS_DESCRIPTION}
{$BUSINESS_DESCRIPTION}
{/if}
<hr>
</div>
{/if}
Notice how we needed to further expand our logic to check if just one (or both) of the pieces exist. Let's imagine if we didn't do this further check... What would happen if a seller had their business description stored, but not their logo? The template would render the description just fine, but without the conditional it would expect to get a logo URL, and therefore display a broken image.
10. Seller's inter-eBay links
These are the grouping of links that allow a seller's potential buyers to learn more about them within the eBay system. At present, the BiggerBids system only renders proper links for US-based eBay sellers.
<!-- Display required inter-eBay links -->
<div class="BbEbayLinks">
{if $EBAY_FEEDBACK_LINK}<a href="{$EBAY_FEEDBACK_LINK}">View Our Feedback</a> {/if}
{if $EBAY_AUCTIONS_LINK}<a href="{$EBAY_AUCTIONS_LINK}">Visit Our Other Auctions</a> {/if}
{if $EBAY_ME_LINK}<a href="{$EBAY_ME_LINK}">Learn More About Us</a> {/if}
</div>
Pay close attention to the fact that these links need to be positioned within an "a" tag. This gives the designer more freedom to make these links images if so desired.
11. Cross-promote seller's eBay store
The seller has the opportunity to create a section of links that are intended to cross-promote their eBay store. They can store their store name, a link to their store, each category within their store and its accompanying link.
<!-- Display cross-promotional eBay Store category links -->
{if $EBAY_STORE_NAME}
<div class="BbStoreLink"><a href="{$EBAY_STORE_URL}">{$EBAY_STORE_NAME}</a></div>
{foreach item=cat from=$EBAY_STORE_CATS}
<div class="BbStoreCatLink"><a href="{$cat.url}">{$cat.title}</a></div>
{/foreach}
{/if}
Notice that this piece will only be rendered if they have a store name configured. This is a must in all templates as this is the way the seller configures it within their BiggerBids account.
12. Wrap it all up
So now we've created blocks for each section available to our template. Let's wrap two container tags around all of the code we've created to allow us to center this information on the page as well as provide any template-wide style settings.
<!-- Place all content in one container -->
<div class="BbOuterContainer">
<div class="BbInnerContainer">
All precreated contetent here.
</div>
</div>
13. Add some style
You'll notice the "literal" tag wrapped around our style section. That is 100% necessary or Smarty will not recognize our styles. We'll place the following code at the top of our template to give this template a nice, cohesive look.
<!-- tell the Smarty engine to render the style as it sees it -->
{literal}
<style type="text/css">
<!--
.BbOuterContainer {
text-align: center;
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 12px;
margin-top: 30px;
}
.BbInnerContainer {
width: 760px;
margin: 0 auto;
text-align: left;
}
.BbImageMain {
margin-bottom: 5px;
text-align: center;
}
.BbAuctionTitle {
font-size: 18px;
font-weight: bold;
margin-bottom: 25px;
text-align: center;
}
.BbThumbnails {
text-align: center;
padding: 10px;
border: 1px solid #cccccc;
margin-bottom: 10px;
}
.BbMainInfoBlock {
margin-bottom: 15px;
}
.BbPolicyTitle {
color: #660000;
font-weight: bold;
text-decoration: underline;
margin-bottom: 5px;
}
.BbPolicyDescription {
margin-bottom: 10px;
}
.BbBusiness {
margin-top: 25px;
margin-bottom: 25px;
}
.BbEbayLinks {
margin-bottom: 10px;
}
.BbEbayLinks a {
margin-right: 10px;
}
.BbStoreLink {
font-size: 14px;
font-weight: bold;
}
.BbStoreCatLink {
float: left;
margin-right: 10px;
}
-->
</style>
{/literal}
© 2009 BiggerBids.com. All Rights Reserved.
BiggerBids.com is a property of Nucite Solutions.