Logo

Reverse Auction Factory Templating Documentation


Introduction


Reverse Auction Factory uses a very powerful templating engine - Smarty v2. This documentation provides a guide to each file and its purpose in the Reverse Auction Factory display system.

What is a template engine? A (web) template engine is software that is designed to process web templates and content information to output web documents. It runs in the context of a template system. It is practically a PHP script that interprets some kind of pseudo HTML pages containing placeholders for specific variable content. In our case most are auction related.

This is not a Smarty tutorial, but a HTML experienced user should have no issues working with Smarty templates, also the Reverse Auction variables and objects will be explained, reducing the need for any PHP knowledge.

Smarty operators are similar to PHP's. PHP Operators.

Making use of smarty, the auction engine will provide to the Smarty engine some pre-filled objects and arrays of objects that are relevant to the current page displayed. Also all language constants defined in Reverse Auction Factory can be accessed in the template. We advice against writing hard coded text into the Templates, since this would render the multi language concept useless. If you do not care about the ability to translate your site, then you can do as needed.

Also use the "translate" function which tells smarty to replace a string with the relevant Joomla translation:


  {"COM_RBIDS_SOME_TEXT"|translate}


The default language files are located in [siteroot]language/en-GB/en-GB.com_rbids.ini and [siteroot]/administrator/language/en-GB/en-GB.com_rbids.ini - Use them as a template for translating to other languages.

Template Structure


Pages


Files are located in [siteroot]/components/com_rbids/templates/[template name]/


Main Template File Description
t_auctiondetails.tpl Contains the Template for Displaying the Auction Item Details Page
t_categories.tpl Display of Categories Page (Category Directory)
t_category_tree.tpl Display of Categories Tree Page
t_catselect.tpl Category Selection Page
t_editauction.tpl This is the Template for the “new auction” and “edit” page, the $task Smarty Variable Contains the Current Task (newauction or editauction)
t_googlemap.tpl Google Map Display
t_googlemap_tool.tpl Google Map Select Coordinates Display
t_showusers.tpl User Search Results Page
t_listauctions.tpl Template for Displaying the Auction Lists
t_reportauction.tpl Auction Reporting Page Display
t_rateauction.tpl Rate Auction Page Display
t_myuserdetails.tpl User's Profile display
t_userdetails.tpl Display of Other Users Details
t_myauctions.tpl Similar to listauctions, only for "My auctions"
t_mybids.tpl Similar to listauctions, only for "My Bids"
t_mywatchlist.tpl Similar to listauctions, only for "My watchlist"
t_mywonbids.tpl Similar to listauctions, only for "My won bids"
t_myratings.tpl Display for "My Ratings" page
t_search.tpl Template for the Search Page
t_search_users.tpl Template for the Search Users Page


Elements


Elements Description
Auction Detail Auction Details Elements
Category Category Element
Lists Lists Element
t_header_filter.tpl Search Filters Display
filter_button.tpl My Auctions Page Filter
t_listfooter.tpl Pagination Element
sort_field.tpl Sorting Element


Variables used in all the pages


Variable Description
$cfg Settings for the Whole Extension
$is_logged_in 1 if the user is logged in, 0 otherwise
$option Current Option: com_rbids
$page_title Current Page: Categories
$task Current Task: categories
$template_file Current Template: categories


$auction->get()


Used to call functions from the auctions table, all the returned values will be related to the currently viewed auction.

PHP function Returns
getFavorite()True if the auction is in the user's watchlist
getUsername()Returns the auctioneer's username
getCatname()Returns the category name
getStartDate_Text()Returns the start date
getEndDate_Text()Returns the end date
getCountdown()Returns the expiration countdown timer
getExpired()True if the auction is expired
getTags()Returns the tags
getGallery()Returns the image gallery
getThumbnail()Returns the main image thumbnail
getMust_Rate()True if the user can rate
getOwnerRating()Returns the auctioneer's rating
getLowest_Bid()Returns the lowest bid
getNr_Bidders()Returns the number of bidders
getI_am_winner()True if the user is the winning bidder
getWinning_bid()Returns the winning bid's value
getNr_Bids()Returns the number of bids
getWinner()Returns the winner id
getImages()Returns the Auction images without the gallery plugin
getImageCount()Returns the number of images
getMessages()Returns the auction messages, taking note of private auctions
getBidList()Returns the bid list array


Example:


{if $auction->get('Favorite')} You are Watching this Auction {/if}


Will output the text on watched auctions.



(!) Documentation based on Reverse Auction Factory version 4.3.3