Containers
Introduction | Product Macros | Category Macros | Content Macros | Menu Macros | Navigation Macros
Introduction
Containers are HTML snippets or templates which define how to display an O3 object like a product, category, menu or content-item.
They are very simple. If you're building your site from a template - which most people are - you just copy the HTML which displays the product (or whatever) from the template into O3, then replace any specific stuff with O3's container symbols.
Most things in O3 have 2 types of container: a List container - to use when showing a list of things, and a Detail container for sowing all an object's attributes. This applies to Products, Categories, Items, Content and Schedules. Menus & Navigation don't ned this distinction.
The benefit of using containers that it gives you complete control over your site design. Also, if you decide to change how things are displayed, you only have to change it in one place - O3's Containers Manager. Containers are essential if you want to use the Products-Wizard functions and the Catalog Page. The set of default containers is defined in the settings, but you can override the defaults by passing the container name into the function calls.
There are examples of containers in the example data set. Here's a simple product container:
<!-- Product Container - Small -->
<table class='prsmall'>
<tr><th>PR-NAME</th></tr>
<tr><td align='center'><a href='PR-URL' title="Go to the PR-NAME page..."><img src='PR-IMAGE' border='0'></a></td></tr>
<tr><td>PR-DESC</td></tr>
<tr><th>£PR-PRICE</th></tr>
<tr><th>PR-PPBUYhttps://www.paypal.com/en_US/i/btn/x-click-but02.gif#</th></tr>
</table>
...and here is how the container is used:
echo show_product($item, 'Container');
Other Containers
This section lists some of the core containers in O3. The Order Confirmation Email Containers is also part of the core.
Some modules have containers too. There are: Schedule Containers, Content Containers, and Item Containers.
Product Container Macros
Here's a list of all the symbols which can be used in O3's product containers, and what they're replaced with.
| Macro | Is Replaced By |
| PR-NAME | Product Name |
| PR-DESC | Product (short) description |
| PR-CATEGORY | Category |
| PR-FULLDESC | Full Description |
| PR-IMAGE | Small Image |
| PR-LARGEIMAGE | Large Image |
| PR-URL | Product page URL |
| PR-PRICE | Price (No currency symbol is displayed) |
| PR-SETUPFEE | Setup Fee |
| PR-VALIDFROM | Date the product is valid from. |
| PR-VALIDTO | Date the product is valid to. |
| PR-LEV1COMMISSION | Commission for affiliate who made the sale. |
| PR-LEV2COMMISSION | Commission for affiliate whose referrer made the sale. |
| PR-LEV3COMMISSION | Commission for affiliate whose referrer's referrer made the sale. |
| PR-SUBSCR | Subscription? Shows 'Yes' or 'No' |
| PR-RENEWAL | Renewal period for a subscripption |
| PR-REPEATS | Number of repeats for a subscription. If blank = forever. |
| PR-TRIAL | Trial period. |
| PR-SHIP1 | Shipping cost 1 (one price for all) |
| PR-SHIP2 | Shipping cost 2 (per additional item) |
| PR-HANDLING | Handling fee |
| PR-OPTION1 | Option 1 (i.e. 'Colour') |
| PR-OPTION2 | Option 2 |
PR-PPBUY# PR-PPBUYimg/image.gif# | PayPal Buy button. This can have an 'override' image specified - as in the lower example to override the default image set in the Settings. This symbol must have the terminating '#'! |
| PR-PPCART# | |
| PR-SPBUY# | StormPay Buy button. This can also have an 'override' image specified. As above. |
| PR-SPCART# | StormPay 'Add To Cart' button. This can also have an 'override' image specified. As above. |
| PR-RELATEDPcontainer# | Show any Related Products in the (optional) specified container. This symbol must have the terminating '#'! |
| PR-RELATEDCcontainer# | Show any Related Categories in the (optional) specified container. This symbol must have the terminating '#'! |
| PR-DOWNLOAD-URL | The URL of the download link to the product. Put this in the href attribute of a link. This will be blank if no file is specified for the product! |
| O3VAR# | Any internal value from the item's data or type data (i.e. O3VARsize#)
|
| O3IFa|b|c|dO3ENDIF | A simple comparison operator. If a=b then c is output, else d. The contents can contain other macros as all others are parsed first. Note this macro has a different terminator to the others to allow you to embed them within an O3IF. |
Category Container Macros
Here's a list of all the symbols which can be used in O3's category containers, and what they're replaced with.
| Macro | Is Replaced By |
| CT-NAME | Product Name |
| CT-DESC | Product (short) description |
| CT-FULLDESC | Full Description |
| CT-IMAGE | Small Image |
| CT-PRODUCTScontainer# | A list of the category's products in the (optional) container specified. |
| CT-CATEGORIEScontainer# | A list of the category's sub-categories in the (optional) container specified. |
| O3VAR# | Any internal value from the item's data or type data (i.e. O3VARsize#)
|
| O3IFa|b|c|dO3ENDIF | A simple comparison operator. If a=b then c is output, else d. The contents can contain other macros as all others are parsed first. Note this macro has a different terminator to the others to allow you to embed them within an O3IF. |
Content Container Macros
Here's a list of all the symbols which can be used in O3's content containers, and what they're replaced with.
Hint: If you want a product to appear in the small container, use the CN-PRODUCTS-NAME macro, and specify the products name exactly in the regular expression
| Macro | Is Replaced By |
| CN-NAME | Content Name |
| CN-DESC | Content description |
| CN-TITLE | Content Title |
| CN-UPDATED | Updated date |
| CN-CREATED | Created date |
| CN-CONTENT | Content HTML or Text |
| CN-PRODUCTproduct# | Show the specified product in the Product-Large container. |
| CN-PRODUCTS-NAMEname like# | Show the list of products whose name matches the regular expression in the Product-Small container. |
| CN-PRODUCTS-CATEGORYname like# | Show the list of products whose category matches the regular expression in the Product-Small container. |
| CN-CATEGORIEScategory# | Show the list of categories whose name matches the regular expression in the Category-Small container. |
| CN-CATEGORYcategory# | Show the specified category in the Category-Large container. |
| O3VAR# | Any internal value from the item's data or type data (i.e. O3VARsize#)
|
| O3USR# | Any value from the current user's data or type data (i.e. O3USRus_email#)
|
| O3IFa|b|c|dO3ENDIF | A simple comparison operator. If a=b then c is output, else d. The contents can contain other macros as all others are parsed first. Note this macro has a different terminator to the others to allow you to embed them within an O3IF. |
Menu Container Macros
Here's a list of all the symbols which can be used in O3's menu containers, and what they're replaced with.
| Macro | Is Replaced By |
| CT-NAME | Category name. |
| CT-DESC | Category description |
| CT-FULLDESC | Category full description |
| CT-URL | Category URL.. Link to catalog page to show the category in the Category-Large container. |
| CT-IMAGE | Category image. Should reside in the Image Directory specified in the settings |
| CT-PR-COUNT | The number of products in the category |
| CT-CN-COUNT | The number of content items (articles) in the category |
| CT-BOLD | This is set to the following text if the menu item is the current page: " style='font-weight:bold'" |
| MN-DEPTHhtml# | The hierarchy depth indicator html. This is usually just some spaces to indent the menu item, but you can use any HTML (60 chars) |
| O3VAR# | Any internal value from the item's data or type data (i.e. O3VARsize#)
|
| O3USR# | Any value from the current user's data or type data (i.e. O3USRus_email#)
|
| O3IFa|b|c|dO3ENDIF | A simple comparison operator. If a=b then c is output, else d. The contents can contain other macros as all others are parsed first. Note this macro has a different terminator to the others to allow you to embed them within an O3IF. |
Navigation Container Macros
Here's a list of all the symbols which can be used in O3's navigation containers, and what they're replaced with.
| Macro | Is Replaced By |
| FIRST-ITEM | The row number of the first item displayed. |
| LAST-ITEM | The row number of the last item displayed. |
| ITEM-COUNT | The total number of items. |
| THIS-PAGE | The page number of the current page. |
| PAGE-COUNT | The total number of pages. |
| PREV-URL | URL of the previous page. |
| NEXT-URL | URL of the next page. |
| O3VAR# | Any internal value from the item's data or type data (i.e. O3VARsize#)
|
| O3USR# | Any value from the current user's data or type data (i.e. O3USRus_email#)
|
| O3IFa|b|c|dO3ENDIF | A simple comparison operator. If a=b then c is output, else d. The contents can contain other macros as all others are parsed first. Note this macro has a different terminator to the others to allow you to embed them within an O3IF. |
|