Support » Knowledge Base » Shop-Script » Design & templates setup »
The built-in design editor allow use of Smarty conditions for individual design setup on different storefront pages. For example, you may need to display an advertising banner only on product details pages or useful tips for customers anywhere except for the home page. To use Smarty conditions, click the "Advanced mode (HTML)" link in the design editor window.
Online storefront in Shop-Script consists of the following types of pages (address parameters of each page are specified in the parentheses):
To determine the current page type, your condition must check the value of its address parameter in the $smarty.get array as shown below:
{if $smarty.get.ukey eq 'pricelist'}
text or HTML code
{else}
alternative text or HTML code — the optional part is colored gray
{/if}This code must be added to the desired part of the advanced design editor window.
How does this example work?
To create an opposite condition, i.e. "if the current page is NOT the price list page", use the ne operator instead of eq; e.g.:
{if $smarty.get.ukey ne 'pricelist'}
text or HTML code
{else}
alternative text or HTML code — the optional part is colored gray
{/if}How does this example work?
Tip: In the 2nd line of the condition you can add either your custom text or HTML code or a part of the original code already contained in the editor window. This may be useful to set up different appearance for standard page blocks such as main menu, news titles list, language selection block, etc.
Tip: Adding custom text to the storefront with translation into other languages is described in this article.
Below are provided several examples which will help you to write your own Smarty conditions.
{if $smarty.get.productID ne ''}Note: This condition is understood as "if the productID value is not empty, i.e. the current page is some product details page with an arbitrary productID value".
{if $smarty.get.productID eq 123}{if $smarty.get.categoryID ne ''}{if $smarty.get.ukey eq 'register' or $smarty.get.ukey eq 'auth'}Note: Several conditions can be combined using the or operator, which means that either one or both of the specified conditions must be satisfied.
{if $smarty.get.ukey eq 'auxpage_about'}
Tip: More details about the use of Smarty syntax are available in the online reference at http://www.smarty.net/manual/en/.