{init_metadata}
This functionality is deprecated in version 4, please use profiles instead.
{init_metadata} returns the metadata name-value pairs for given object. It's useful when you want to display all metadata information for some object. Objects having metadata available are: articles, sections, subjects, messages, documents, albums.
Parameters
- id - object ID
- name - variable name where the returned data is saved. Default value is "metadata".
Attributes
- name - metadata name
- value - object's metadata value
Sample:
{init_metadata id=$obj->id}
{foreach from=$metadata item=meta}
<br>{$meta.name} = {$meta.value}
{/foreach}
{init_calendar}
Tag {init_calendar} allows developers to add the calendar box to the template. It prints a calendar box where predefined dates are selected.
Parameters
- name - variable name where the returned data is saved. Default value is "cal".
- start_date - defines default start date of the selected days' range. If start_date is undefined, today's date is used.
- end_date - defines default end date of the selected days' range. If end_date is undefined, today's date is used.
- parent - section ID of current calendar. If parent is undefined current page's ID is used. 3.3.10 4.0.14
- hide_weeknumbers - hide the weeknumbers in the calendar. Possible values 0 or 1, default value is 0. 3.3.10 4.0.14
- hide_month_link - hide the month link in the calendar. Possible values 0 or 1, default value is 0. 3.3.10 4.0.14
- hide_today_link - hide the today link in the calendar. Possible values 0 or 1, default value is 0. 3.3.10 4.0.14
- send_variables - add all variables found in GET/POST array to the target links
Attributes
- html - prints HTML-code of the calendar.
- start_date - start date of the selected days' range
- end_date - end date of the selected days' range
Styles
You can can overwrite all calendar styles using your own custom CSS. Following styles are used in the calendar HTML:
- .cal_off
- .cal
- .cal_actual
- .cal_nottoday
- .today_nolink
- .caltext
- .cal_maintable - 3.3.10 4.0.14
- .cal_selectbox_tr - 3.3.10 4.0.14
- .cal_weekday_tr - 3.3.10 4.0.14
- .cal_spacer_tr- 3.3.10 4.0.14
Examples
{* Print calendar where default selected dates are from 01.01.2003 until 01.01.2003.*}
{init_calendar name="cal" start_date="01.01.2003" end_date="01.01.2003"}
Calendar: <br>
{$cal_html} <br>
Currently selected dates in the calendar are:
{$cal_start_date} - {$cal_end_date}
{init_events}
Tag {init_events} prints out event objects in the current section. It is often used in combination with calendar object.
Parameters
- parent - ID number of the current section where events belong. If parent is undefined then current page ID is used.
- name - variable name where the returned data is saved. Default value is "eventlist".
- position - defines the location of sections' list on the page.
- order - defines the ordering of events loop. Could be either ascending (value then "asc") or descending (value "desc"). Possible values to order by are: title, date, start_time, end_time. Default ordering is by start_time, then title.
- start - the starting row number to return. 3.x
- limit - the number of rows to return. You must use this parameter always with "start" parameter. 3.x
- start_time - return events between start_time and end_time, in format dd.mm.yyyy. 4.0.0
- end_time - return events between start_time and end_time, in format dd.mm.yyyy. 4.0.0
- metadata - defines the type of metadata set events use in this section. Only used then metadata sets exist in a database.
This functionality is deprecated in version 4, please use profiles instead. - on_create - allows to publish all objects immediately. If the parameter has value "on_create=publish", then a created object is published immediately. Default value is "hide". 4.0.2
- where - additional filtering criteria using WHERE SQL syntax. 4
- buttons - defines which action buttons are displayed to the site editor. Values can be "new,edit,hide,move,delete". 4.0.14
- user - list of users to display. 4
Attributes
- id - ID number of the current event.
- href - link to the current event.
- title - title of the current event.
- is_selected - value is 1 in case of active (selected or current) event, 0 otherwise.
- buttons - action-buttons for the current event.
- start_date - start date of the event in format dd.mm.yyyy
- start_time - start time of the event in format hh:mm.
Since version 3.3.0 new format is dd.mm.yyyy hh:mm - start_date_long - start date of the event in format dd. month yyyy
- end_date - end date of the event in format dd.mm.yyyy
- end_time - end time of the event in format hh:mm
Since version 3.3.0 new format is dd.mm.yyyy hh:mm - end_date_long - end date of the event in format dd. month yyyy
- description - description of the event
- created_user_id - user ID who initially created the object. 4.0.3
- created_user_name - user full name who initially created the object. 4.0.3
- changed_user_id - user ID who made the last object saving. 4.0.3
- changed_user_name - user full name who made the last object saving. 4.0.3
- created_time - creating time of the object in format dd.mm.yyyy hh:ii. 4.0.3
- fcreated_time - creating time of the object in database default format, eg yyyy-mm-dd hh:ii. 4.0.3
- changed_time - last saving time of the object in format dd.mm.yyyy hh:ii. 4.0.3
- fchanged_time - last saving time of the object in database default format, eg yyyy-mm-dd hh:ii. 4.0.3
General tags
- <name>_newbutton - prints "New" action-button for creating a new object.
- <name>_count - the number of returned objects. If parameter "limit" is set then count equals to "limit" value.
- <name>_counttotal - the total number of objects found, not affected by "limit" parameter. 3.3.7
{init_order}
Tag {init_order} returns the orders. 3.3.7
Parameters
- name - variable name where the returned data is saved. Default value is "order".
- order_nr - the order number. If not defined, the last order in the database is returned.
Attributes
- order_nr - the order number
- date - the date of the order
- fdate - the date of the order in format yyyy-mm-dd
- sum - the sum of the order, monetary value
- vat - the VAT of the order, monetary value
- transport - the code of the transport type for the order. Transport codes can be arbitrary number values and are defined in the order template.
- status - the status of the order. Possible values are: Ordered, Dispatched, Delivered, Cancelled
- payment_status - the payment status of the order. Possible values are: Ordered, Kredit confirmed, Payed, Free, Refund.
- flast_modified - the date of the last modification of the order in format yyyy-mm-dd
- user_data - the content of the user data, saved as serialized array
- cart_data - the content of the cart, saved as serialized array
Example
{init_order order_nr=$order_nr}
<p>{sysword word="eel_arve" type="e_commerce" load_all=1} {$order_id}</p>
<table cellpadding="0" cellspacing="0">
<tr>
<th align=right>Kuupaev:</th>
<td>{$order->date}</td>
</tr>
<tr>
<th align=right>Nimi:</th>
<td>{$order->user_data.eesnimi} {$order->user_data.perekonnanimi}</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<th>
<div align="left">Kaup</div>
</th>
<th>
<div align="right">Hind</div>
</th>
<th>
<div align="right">Kogus</div>
</th>
<th>
<div align="right">Summa</div>
</th>
</tr>
{foreach from=$order->cart_data item=cart}
<tr>
<td>
<div align="left">{$cart.title}</div>
</td>
<td>
<div align="right">{$cart.price}</div>
</td>
<td>
<div align="right">{$cart.qty}</div>
</td>
<td>
<div align="right">{$cart.sum}</div>
</td>
</tr>
{/foreach}
<tr>
<td>
<div align="left"></div>
</td>
<td>
<div align="right"></div>
</td>
<td>
<div align="right"></div>
</td>
<td>
<div align="right"></div>
</td>
</tr>
<tr>
<td colspan="3">
<div align="right">Saatekulud:</div>
</td>
<td>
<div align="right">{$order->transport}</div>
</td>
</tr>
<tr>
<td colspan="3">
<div align="right"><b>Kokku:</b></div>
</td>
<td>
<div align="right"><b>{$order->sum}</b></div>
</td>
</tr>
<tr>
<td colspan="3">
<div align="right">Kaibemaks</div>
</td>
<td>
<div align="right">{$order->vat}</div>
</td>
</tr>
</table>
{init_carts}
Tag {init_carts} returns an array of saved shopping carts of given user.
Parameters
- name - variable name where the returned data is saved. Default value is "carts".
- user - user ID who owns the carts. If not defined then currently logged in user id is used.
Attributes
- data - the content of a cart
- user - the username who owns the cart.
- sum - the total sum (amount * price) of the cart, monetary value.
- vat - the total VAT of the cart, monetary value.
- delete - href for deleting the cart.
- print - href, will open the print window for the cart.
- neworder - href for starting a new order with this cart.
- href - href for showing the details of the cart.
Example
{if $user}
{init_carts user=$userdata->kasutaja_id} <p><font class="pealkiri">Salvestatud ostukorvid</font></p>
<table border=1 width="100%">
<tr>
<td class="boxhead">user</td>
<td class="boxhead">id</td>
<td class="boxhead">date</td>
<td class="boxhead">data</td>
<td class="boxhead">sum</td>
<td class="boxhead">vat</td>
</tr>
{foreach from=$carts item=cart}
<tr>
<td class="txt">{$cart->user}</td>
<td class="txt">{$cart->id}</td>
<td class="txt">{$cart->date}</td>
<td class="txt">{$cart->data}</td>
<td class="txt">{$cart->sum}</td>
<td class="txt">{$cart->vat}</td>
</tr>
{/foreach}
</table>
{else}
<form action="{$self}" method=post>
login: {login_name}
pass: {login_pass}
{login_button}
</form>
{/if}
{init_manufacturer}
Tag {init_manufacturer} prints the list of the manufacturers defined by the administrator.
Parameters
- name - variable name where the returned data is saved. Default value is "manufacturer".
- category_id - category ID
General tags:
- <name>_selected_id - prints the value of active (selected) manufacturer's ID.
{init_productcategory}
Tag {init_productcategory} prints the available product categories.
Parameters
- name - variable name where the returned data is saved. Default value is "productcategory".
- level - defines the level of the product category in the hierarchy (the same logic as in the the tag init_section).
Example
{init_productcategory name="category"}
<select name="cat_id" style="width:250px" onChange="submit()">
<option value="">All</option>
{foreach from=$category key=cat_id item=cat_name}
<option value="{$cat_id}" {if $selected_category = = $cat_id}selected{/if}>{$cat_name}</option>
{/foreach}
</select>
{init_product}
Tag {init_product} prints the detailed information of the specific product.
Parameters
- name - variable name where the returned data is saved. Default value is "product".
- id - ID number of the product to return.
- language_id - defines the language version of the product description
Attributes
- id - prints the product ID
- description - prints the product description
- thumbnail - prints the product thumbnail
- name - prints the product title
- unit - prints product unit e.g. "kg", "tk"
- is_published - return 1 if product published and 0 otherwise
- buttons - action-buttons, available only for editors
- image - prints the product image
- category - prints the category of the product
- category_id - prints the ID number of the protduct's category
- manufacturer - prints the manufacturer of the product
- manufacturer_id - prints the ID number of the product's manufacturer
- model - prints the model of the product
- price - prints the price of the product
- profile_data - the array of the attributes.
{init_products}
Tag {init_products} displayes the list of the product under the selected product category. If no categories are selected, all products will be displayed.
Parameters
- name - variable name where the returned data is saved. Default value is "products".
- formname - name of the form which contains the products. For ordering to work you must define the form name in which the productlist is in. If the correct formname is not defined the add2cart_url and delete_url tags will not work. Available only with e-commerce module.
- cart - defines the ID of the shopping cart where the products on the list belong. Available only with e-commerce module.
- parent - defines parent object's ID of the product list
- category_id - defines the category from where the product list will be displayed
- manufacturer_id - defines the manufacturer whose products will be displayed
- language_id - defines the language of the product information
- order - defines the order of the product list. Possible values: product_category_description.name, product_manufacturer.name, product_description.name,
product_description.description, product.id, product.model, product.price - start - defines the starting row of the product list
- limit - defines the limit of the rows in the product list. You must use this parameter always with "start" parameter.
NB! Default value is 20. - where - Can be used in filtering or searching the product list. Examples: where="product.price>'0'" or where="product.model = 'tv-set'" or where="product_description.name = 'Sanyo'"
- pagenum_separator - the character that separates the page number in the paging list
- pagenum_next_chr - the character (string) for the link to the next product list's page
- pagenum_prev_chr - the character (string) for the link to the previous product list's page
- pagenum_link_class - the CSS-class for the links in the paging list
- pagenum_numbers_style - the CSS-class for the numbers in the paging list
Attributes
- buttons - displayes the action buttons for the editors
- thumbnail - displayes the thumbnail of the product picture
- category - prints the category of the product
- category_id - prints the ID number of the protduct's category
- manufacturer - prints the manufacturer of the product
- manufacturer_id - prints the ID number of the product's manufacturer
- model - prints the model of the product
- description - prints the description of the product
- price - prints the price of the product
- add2cart_url - This is the href which takes you to the "The product has been added to your shopping cart page". (This also adds the product to the cart) . Available only with e-commerce module.
- delete_url - This is the href which deletes the product from the shopping cart. Available only with e-commerce module.
- amount_boxname - If you wish to specify an amount of products to add to the shoppingcart, this is the name of the <input type= "text"> field. Available only with e-commerce module.
- amount - This is the amount of a product in a shoppingcart. Available only with e-commerce module.
- sum - prins the sum of a product i.e. price * amount . Available only with e-commerce module.
- price_f - Prints the formated price. Available only with e-commerce module.
General tags
- <name>_newbutton - prints "N-button" to create new product
- <name>_count - total number of products in current list, dependent on the the limit parameter.
- <name>_rows- total number of the products, independent from the limit parameter.
- <name>_pages - prints the paging links
- <name>_pagenumbers - prints the paging links
- <name>_previous - prints the link to the previous product page
- <name>_next - prints the link to the next product page
- <name>_total - Total sum of all products in a shopping cart
{init_language}
This function is deprecated from 4.6.4, use init_sites instead.
{init_language} returns all active languages of the website.
Parameters
- name - defines variable name where the returned data is saved. Default value: "language".
Attributes
- href - link to the language changing page, eg "?lang=en"
- name - language full name, eg "English"
- extension - abbreviation of language, eg "EN"
- id - language ID, eg "1" 4.2.2
- home_id - home section ID for this language 4.2.2
Sample:
{init_language name="languages"}
{foreach from=$languages item=language}
<a href="{$language.href}">{$language.name}</a><br>
{/foreach}
{init_document}
Tag {init_document} displayes detailed information of one document.
Parameters
- id - ID number of the document to return
- name - variable name where the returned data is saved. Default value is "document".
- buttons - defines which action buttons are displayed to the site editor. Values can be "new,edit,hide,move,delete".
- on_create - allows to publish all objects immediately. If the parameter has value "on_create=publish", then a created object is published immediately. Default value is "hide". 4.0.2
Attributes
- id - ID number of the document.
- parent_id - ID number of parent object.
- title - title of the document.
- is_selected - value is 1 in case of active document, 0 otherwise.
- buttons - action-buttons, available only for editors.
- date - date of the document.
- fdate - date of the document in database default format, eg yyyy-mm-dd.
- datetime - date and time of the document, format dd.mm.yyyy hh:mm. 4.4.1
- fdatetime - date and time of the document in database format, eg yyyy-mm-dd hh:mm:ss. 4.4.1
- download_link - hyperlink for downloading the document.
- filename - name of the document.
- description - description of the document.
- size - size of the document in bytes.
- size_formated - size of the document in bytes. Formatted.
- author - author of the document.
- last_modified - objects last modified time.
This functionality is deprecated in version 4, please use changed_time instead. - class - class name of the object.
- hit_count - returns page load count of the object. 3.3.1
- comment_link - the link to the comment board of an document. 3.3.9
- comment_title - the title of the link to the comment board of an document (system word). 3.3.9
- add_comment_link - the hyperlink to the "add comment" form. 3.3.9
- add_comment_title - the title of the link to the "add comment" form. 3.3.9
- created_user_id - user ID who initially created the object. 4.0.3
- created_user_name - user full name who initially created the object. 4.0.3
- changed_user_id - user ID who made the last object saving. 4.0.3
- changed_user_name - user full name who made the last object saving. 4.0.3
- created_time - creating time of the object in format dd.mm.yyyy hh:ii. 4.0.3
- fcreated_time - creating time of the object in database default format, eg yyyy-mm-dd hh:ii. 4.0.3
- changed_time - last saving time of the object in format dd.mm.yyyy hh:ii. 4.0.3
- fchanged_time - last saving time of the object in database default format, eg yyyy-mm-dd hh:ii. 4.0.3
- comment_count - the number of comments. 3.3.9 4.0.6
- last_commented_time - the last comment time in format dd.mm.yyyy hh:ii. 4.0.6
{init_documents}
Documents are files which are uploaded to the web server and saved into the database. They can be downloaded by users by clicking on a document link.
Tag {init_document} allows to call out some or all document records within one section. With this tag you can create a page which shows you all documents uploaded into the section.
Parameters
- parent - section ID value(s) from where to get the documents. Multiple ID values must be comma separated. If parent is not defined then current page ID is used.
- name - variable name where the returned data is saved.
- start - the starting row number to return.
- limit - the number of rows to return. You must use this parameter always with "start" parameter.
- position - defines the location of document' list in the page. You can use any numbers for position.
- order - defines how documents are sorted. Articles can be sorted by article title, date or author name with descending or ascending order. Sample: order="title desc".
- metadata - defines the metadata ID. Only used when metadata sets exist in a database.
This functionality is deprecated in version 4 , please use profiles instead. - where - additional filtering criteria using WHERE SQL syntax. 3.3.4
- on_create - allows to publish all objects immediately. If the parameter has value "on_create=publish", then a created object is published immediately. Default value is "hide". 4.0.2
Attributes
- id - ID number of the document.
- parent_id - ID number of parent object.
- title - title of the document.
- is_selected - value is 1 in case of active document, 0 otherwise.
- buttons - action-buttons, available only for editors.
- date - date of the document.
- fdate - date of the document in database default format, eg yyyy-mm-dd.
- datetime - date and time of the document, format dd.mm.yyyy hh:mm. 4.4.1
- fdatetime - date and time of the document in database format, eg yyyy-mm-dd hh:mm:ss. 4.4.1
- details_link - hyperlink of the detailed view of the document
- download_link - hyperlink for downloading the document.
- filename - name of the document.
- description - description of the document.
- size - size of the document in bytes.
- size_formated - size of the document in bytes. Formatted.
- mime_type - MIME type of the document.
- author - author of the document.
- last_modified - object's last modified time.
This functionality is deprecated in version 4, please use changed_time instead. - created_user_id - user ID who initially created the object. 4.0.3
- created_user_name - user full name who initially created the object. 4.0.3
- changed_user_id - user ID who made the last object saving. 4.0.3
- changed_user_name - user full name who made the last object saving. 4.0.3
- created_time - creating time of the object in format dd.mm.yyyy hh:ii. 4.0.3
- fcreated_time - creating time of the object in database default format, eg yyyy-mm-dd hh:ii. 4.0.3
- changed_time - last saving time of the object in format dd.mm.yyyy hh:ii. 4.0.3
- fchanged_time - last saving time of the object in database default format, eg yyyy-mm-dd hh:ii. 4.0.3
- comment_count - the number of comments. 4.0.6
- last_commented_time - the last comment time in format dd.mm.yyyy hh:ii. 4.0.6
General tags
- <name>_newbutton - prints "New" action-button for creating a new object.
- <name>_count - the number of returned objects. If parameter "limit" is set then count equals to "limit" value.
- <name>_counttotal - the total number of objects found, not affected by "limit" parameter. 3.3.7
Example: Simple document list
{init_documents name="docs"}
{foreach from=$docs item=obj}
{$obj->buttons}
<a href="{$obj->detailed_link}">{$obj->title}</a> Download: (<a href="{$obj->download_link}">{$obj->file}.</a> )
{$obj->date}
{$obj->size_formated}
author:{$obj->author}
description:{$obj->description}
{foreachelse}
{$docs_newbutton}
{/foreach}
More Deprecated Tags
The following Saurus API tags are abandoned during development process. Each tag is replaced by more flexible API tags or features.
- {print_menu} - prints the default vertical menu which consist section from levels 2-4.
- {print_topmenu} - prints default horizontal menu which consist section from level 1.
- {print_header} - prints default header article which is one of a system article.
- {print_footer} - prints default footer article which is one of a system article.
- {print_navbar} - prints default location bar, which displays full path of user's navigation in your site.
- {print_comments} - prints default comment board.
Additional parameter "targeturl" added since version 3.3.1 .
{print_comments targeturl=http://www.neti.ee}, which defines the page where user will be sent after submission. - {print_box} - Prints add-on boxes.
- {print_users_form} - prints user profile fields table. 4
{print_box}
Print_box allows you to insert Saurus CMS add-on boxes (like gallups, link lists etc.) to your page templates. This functionality is deprecated in version 4, please use various SAPI tags instead.
Parameters
- position - defines the location of add-on boxes in the page. Default value: 8
- name - variable name where the returned data is saved. Default value is "box".
- parent - parent ID. If parent is undefined, current page ID is used.
- is_custom - if parameter value is set to 1, then you can use print_box tag's elements to customize your add-on boxes HTML-code, otherwise it will print default HTML-code.
- url - additional URL part, is added to the end of the generated links. 3.3.15 4.0.6
Attributes
- buttons - action-buttons for every add-on box.
- title - add-on boxes title.
- contents - add-on boxes content.
{*Add-on box with default HTML*}
{print_box position="10"}
{*Add-on boxes with custom HTML*}
{print_box position=2 name="box" is_custom=1}
{foreach from=$box item=curr_obj}
buttons: {$curr_obj.buttons}<br>
title: {$curr_obj.title}<br>
contents: {$curr_obj.contents}<br>
{/foreach}
{print_comments}
Prints the entire comment board page: the list of comments and the new comment box below. You can can overwrite all comment board styles using your own custom CSS. Following styles are used in the comment board HTML:
/* COMMMENTS FOR ARTICLES, DOCUMENTS, IMAGES ETC. */
/* The area that fits the comments and the form to submit new comment */
#scms_comments_area_table {
}
/* The "adding new" comment area */
#scms_comment_add_table {
}
/* All new comment input fields */
#scms_comment_add_table INPUT,
#scms_comment_add_table TEXTAREA {
}
/* New comment message text input area */
#scms_comment_add_table TEXTAREA {
width: 445px;
height: 100px;
}
/* New comment submit posting button */
#scms_comment_add_table .searchbtn {
}
{print_users_form}
Deprecated starting from version 4.4.3. Use more flexible tags {init_profile}, {save_profile}, {init_mailinglist}, {save_mailinglist}, {init_sso}, {save_sso} instead. For a comprehensive example see the registration template in "saurus4" example.
Prints a table with each user's profile field is in one row: label and form input field.
Parameters
- profile_id - user profile ID value to use. Optional parameter, default user profile is used by default.
- group_id - group ID value where a new user is assigned to. Optional parameter, group "Everybody" is used by default. 4.3.4
Example (see full example in content template "User registration and profile" in Saurus4 default extension)
{print_users_form group_id="3"}
