Dutch Auction Factory uses a very powerful templating engine - Smarty v2. This documentation provides a guide to each file and its purpose in the Dutch 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 Dutch 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 Dutch 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_DUTCHFACTORY_SOME_TEXT"|translate}
The default language files are located in [siteroot]language/en-GB/en-GB.com_dutchfactory and [siteroot]/administrator/language/en-GB/en-GB.com_dutchfactory - Use them as a template for translating to other languages.
Files are located in [siteroot]/components/com_dutchfactory/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_choose_category.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_editprofile | Template for editing "t_myuserdetails_js.tpl" |
t_listauctions.tpl | Template for Displaying the Auction Lists |
t_myauctions.tpl | Similar to listauctions, only for "My auctions" |
t_myblacklist.tpl | Displays list of blocked users |
t_myboughtitems.tpl | Similar to listauctions, only for "My Bought Items" |
t_myprofileextended.tpl | Template for the "My Profile", "Payment Balance", "Messages Received", "Default Settings" and "My Ratings" |
t_myuserdetails.tpl | User's Profile display |
t_mywatchlist.tpl | Similar to listauctions, only for "My watchlist" |
t_report_auction.tpl | Auction Reporting Page Display |
t_search.tpl | Template for the Search Page |
t_showusers.tpl | User Search Results Page |
t_tags.tpl | Includes "t_listauctions.tpl" |
t_userdetails.tpl | Display of Other Users Details |
t_userratings.tpl | Display for "My Ratings" page |
Pages | Elements |
---|---|
auction_details | t_auction_actions.tpl, t_auctiondetails_js.tpl, t_bid_list.tpl, t_bidbox.tpl, t_detail_header.tpl, t_edit_cancel_buttons.tpl, t_tab_item_details.tpl, t_tab_messaging.tpl, t_tab_other_items.tpl, |
auction_list | t_list_sort.tpl, t_listauctions_gridcell.tpl, t_listauctions_listcell.tpl, t_listauctions_listdetailcell.tpl |
categories | t_subcategories.tpl |
category | t_category_js.tpl, t_category_mode.tpl |
editauction | t_auction_detail.tpl, t_pictures_upload.tpl |
myauctions | t_myauctions_cell.tpl |
myboughtitems | t_myboughtitems_cell.tpl, t_myboughtitems_js.tpl |
myuserdetails | t_display_userprofile.tpl, t_edit_defaultsettings.tpl, t_editprofile_form.tpl, t_message_inbox.tpl, t_myratingstable.tpl, t_myuserdetails_js.tpl |
mywatchlist | t_mywatchlist_cell.tpl |
search | t_search_mode.tpl, t_search_users.tpl |
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 |
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 Dutch Auction Factory version 2.0.0.