In-Portal Developers Guide

This is a wiki-based Developers Guide for In-Portal Open Source CMS. The purpose of this guide is to provide advanced users, web developers and programmers with documentation on how to expand, customize and improve the functionality and the code the In-Portal software. Please consider contributing to our documentation writing effort.

K4:Tag Cheat Sheet

From In-Portal Developers Guide

Jump to: navigation, search
Image:Tipbox Icon.gif
  • Tag output parameters are passed to block, specified in "render_as" parameter.
  • Parameters with data type "bool" accepts "1" or "0".

Contents

Editing Data

IsNewMode

Tells, that form data wasn't saved to database yet.

Displaying Data (Lists)

InitList

Performs list initialization and initial database query. Tags "PrintList" and "PrintList2" also process same input parameters as "InitList" tag.

input parameters

name values description
list_name (string) Defines name, that will be used to keep list filter defined via "types" and "except" parameters. Can be used only for categories and category items.
requery (bool) Discard previously retrieved from database data and retrieve it again.
offset (int) Start displaying data only starting from given zero-based record number.
per_page (int), max_items (int) any number or "-1" Display only given count of database records per page or pass "-1" to display all records. When missing and not set by user (via theme list "Items Per Page" control), then value from "default_per_page" is used.
default_per_page (int) any number or "-1" Used as default value for "per_page" parameter. When missing, then 10 items per page are displayed.
sort_by (string) FieldName2,Order2". For example: "LastName,asc|BirthDate,desc".
types (string) Comma separated types of data to display.
except (string) Comma separated types of data to hide.

PrintList, PrintList2

Displays data from database table.

input parameters

name values description
no_table (bool) Don't use HTML table for data output. Is enabled by default for "PrintList" tag.
list_name (string) Defines name, that will be used to keep list filter defined via "types" and "except" parameters. Can be used only for categories and category items.
limit (int) Allows to print less records, then are retrieved using "per_page"/"default_per_page" parameters.
direction (string) "H" or "V" Defines order, how data should be displayed in table (only, when "no_table" parameter is not used):
  • "H" - horizontal layout
A B C
D E F
K L M
  • "V" - vertical layout
A D K
B E L
C F M
columns (int) Columns count used to display data.
render_as (string) Block name, that will be used to display one database table record.
row_start_render_as (string) Block name, that will be used to display row start ("<tr>" by default).
row_end_render_as (string) Block name, that will be used to display row end ("</tr>" by default).
empty_cell_render_as (string) Block name, that will be used to display empty cell ("<td>&nbsp</td>" by default).
more_link_render_as (string) Block name, that will be used to display "More ..." link, when there is more data in database, then is displayed to user (actually calls "MoreLink" tag with given block name).

output parameters

name values description
column_width (int) Column width in percents, that is calculated based on "columns" parameter value.
is_last (bool) Allows to determine, that this is last displayed record.
not_last (bool) Allows to determine, that this is not last selected from database record.
last_row (bool) Allows to determine, that this is last row being displayed.
first_col (bool) Allows to determine, that this is first column being displayed.
last_col (bool) Allows to determine, that this is last column being displayed.
column_number (int) Contains current printed column number.
num (int) Contains current printed record index.

MoreLink

Used to display "More ..." link, when there are more records selected from database, then displayed to user.

input parameters

name values description
render_as (string) Block name, that contains "More ..." link HTML.

PageLink

Used to display link to given page in pagination bar.

input parameters

name values description
template (string) Template name, that should be used in page link. When omitted, then current page is used.
page (int) Page number (optional).

Field

Used to display data from individual field in current database record

input parameters

name values description
name (string), field (string) Requested field name from database table
no_special (bool) Don't apply "htmlspecialchars" function to retrieved field value. It is applied by default to prevent sql-injection/hacking attempts.
db (bool) Don't apply any kind of formatting to field value, just display what's in database.
currency (string) ISO code of currency, that should be used to display price, store in the field. There are also 2 possible special values:
  • primary - always display in primary currency
  • selected - display in currency, selected by user (when user haven't selected anything, then primary currency is used)
format (string) Format string (optional) used to display field value. For dates is date format, for files it's url/path to file and so on.
negative (bool) Displays "-" before field value in case if field value is positive.
checked (bool) Returns "checked" word, when field value is equals to "1" or value, given in "value" parameter.
value (string) Used along with "checked" parameter only.
plus_or_as_label (bool) Translates text from given field. Only useful in cases, when field value is using following notation: "+text", "label_name".
as_label (bool) Translates text from given field assuming, that field value is actually label name.
first_chars (int), cut_first (int) Displays only given first chars count of field value.
nl2br (bool) Replaces new line symbols with "<br/>".