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

(Difference between revisions)
Jump to: navigation, search
(design)
(data added)
Line 1: Line 1:
-
{{TipBox|Tag output parameters are passed to block, specified in "render_as" parameter.}}<br/>
+
{{TipBox|
 +
* Tag output parameters are passed to block, specified in "render_as" parameter.
 +
* Parameters with data type "bool" accepts "1" or "0".
 +
}}<br/>
 +
 
 +
== Editing Data ==
=== IsNewMode ===
=== IsNewMode ===
Tells, that form data wasn't saved to database yet.
Tells, that form data wasn't saved to database yet.
-
=== PrintList, PrintList2 ===
+
== Displaying Data (Lists) ==
-
Displays data from database table.
+
 
 +
=== InitList ===
 +
Performs list initialization and initial database query. Tags "PrintList" and "PrintList2" also process same input parameters as "InitList" tag.
'''input parameters'''
'''input parameters'''
Line 11: Line 18:
|-
|-
! name || values || description
! name || values || description
-
|-
 
-
| {{ConfigProperty|no_table|bool}}
 
-
| "1" or "0"
 
-
| Don't use HTML table for data output. Is enabled by default for "PrintList" tag.
 
|-
|-
| {{ConfigProperty|list_name|string}}
| {{ConfigProperty|list_name|string}}
Line 21: Line 24:
|-
|-
| {{ConfigProperty|requery|bool}}
| {{ConfigProperty|requery|bool}}
-
| "1" or "0"
+
|  
| Discard previously retrieved from database data and retrieve it again.
| Discard previously retrieved from database data and retrieve it again.
|-
|-
Line 35: Line 38:
| any number or "-1"
| any number or "-1"
| Used as default value for "per_page" parameter. When missing, then 10 items per page are displayed.
| Used as default value for "per_page" parameter. When missing, then 10 items per page are displayed.
-
|-
 
-
| {{ConfigProperty|limit|int}}
 
-
|
 
-
| Allows to print less records, then are retrieved using "per_page"/"default_per_page" parameters.
 
|-
|-
| {{ConfigProperty|sort_by|string}}
| {{ConfigProperty|sort_by|string}}
Line 51: Line 50:
|  
|  
| Comma separated types of data to hide.
| Comma separated types of data to hide.
 +
|}
 +
 +
=== PrintList, PrintList2 ===
 +
Displays data from database table.
 +
 +
'''input parameters'''
 +
{| class="wikitable"
 +
|-
 +
! name || values || description
 +
|-
 +
| {{ConfigProperty|no_table|bool}}
 +
|
 +
| Don't use HTML table for data output. Is enabled by default for "PrintList" tag.
 +
|-
 +
| {{ConfigProperty|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.
 +
|-
 +
| {{ConfigProperty|limit|int}}
 +
|
 +
| Allows to print less records, then are retrieved using "per_page"/"default_per_page" parameters.
|-
|-
| {{ConfigProperty|direction|string}}
| {{ConfigProperty|direction|string}}
Line 90: Line 110:
| {{ConfigProperty|more_link_render_as|string}}
| {{ConfigProperty|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.
+
| 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).
|}
|}
Line 129: Line 149:
|  
|  
| Contains current printed record index.
| 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'''
 +
{| class="wikitable"
 +
|-
 +
! name || values || description
 +
|-
 +
| {{ConfigProperty|render_as|string}}
 +
|
 +
| Block name, that contains "More ..." link HTML.
 +
|}
 +
 +
=== PageLink ===
 +
Used to display link to given page in pagination bar.
 +
 +
'''input parameters'''
 +
{| class="wikitable"
 +
|-
 +
! name || values || description
 +
|-
 +
| {{ConfigProperty|template|string}}
 +
|
 +
| Template name, that should be used in page link. When omitted, then current page is used.
 +
|-
 +
| {{ConfigProperty|page|int}}
 +
|
 +
| Page number (optional).
 +
|}
 +
 +
=== Field ===
 +
Used to display data from individual field in current database record
 +
 +
'''input parameters'''
 +
{| class="wikitable"
 +
|-
 +
! name || values || description
 +
|-
 +
| {{ConfigProperty|name|string}}, {{ConfigProperty|field|string}}
 +
|
 +
| Requested field name from database table
 +
|-
 +
| {{ConfigProperty|no_special|bool}}
 +
|
 +
| Don't apply "htmlspecialchars" function to retrieved field value. It is applied by default to prevent sql-injection/hacking attempts.
 +
|}
|}

Revision as of 10:39, 21 April 2010

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.