Frequently Asked Questions v2 |
FAQ Main / Answer Detail |
What are the Parameters of the Alias FunctionsArticle progress: Early Draft |
|
When we setting up aliases for database field on se_fields.php3 page, we sometimes need to change the behavior of alias in som way or we need to pass some parameter for alias handling function such as f_f. The Parameters field is the right place, how to do it. The list of parameters for each alias function follows.
In some cases we need to pass more than one parameter to alias function. In such case the aliases are separated by colon character. If we need to use colon inside parameter, we just use #: string instead of : character.
Function | Parameter | Description |
f_x | transformation | |
content value (pairs) pairs | the content of the field and the value to return, the content can be a regular expression as in http://www.php.net/manual/en/ref.regex.php | |
default | value returned if no match | |
f_0 | null function (nothing shown) | |
none | ||
f_h | print field content due to html flag set (escape html special characters or just print) | |
delimeter | if delimeter parameter is specified, the field with multiple values are displayed as list, delited by delimeter | |
f_d | prints date in user defined format | |
format | format string just like in PHP (like "m-d-Y") - see PHP manual | |
f_i | prints image scr (<img src=...) - NO_PICTURE for none (the functionality of this alias function can be created as conditional f_c function as well) | |
none | ||
f_n | unpacked id | |
none | ||
f_g | prints image height atribut (img height=...) or clears it (the functionality of this alias function can be created as conditional f_c function as well) | |
none | ||
f_w | prints image width atribut (<img width=...) or clears it | |
none | ||
f_a | prints abstract or grabed fulltext text field | |
length | length - number of characters taken from field_id (like "80:full_text.......") | |
field_id | id of fulltex field | |
f_f | prints link to fulltext (hedline url) | |
link_only | field id (like "link_only.......") where switch between external and internal item is stored | |
redirect | url of another page which shows the content of item (like "link_only.......:http#://www.ecn.cz/articles/solar.shtml") (note the #: in previous example!) this page should contain SSI include ../slice.php3 of course | |
f_b | prints text with link to fulltext - more general version of f_f function param: link_only:url_field:redirect:txt:condition_fld (hedline url) | |
link_only | field id (like "link_only.......") where switch between external and internal item is stored | |
url_field | field id of external url for link_only (like hl_href.........) | |
redirect | url of another page which shows the content of item (like "link_only.......:http#://www.ecn.cz/articles/solar.shtml") (note the #: in previous example!) this page should contain SSI include ../slice.php3 of course | |
txt | if txt is field_id content is shown as link, else txt | |
condition_fld | field id - if no content of this field, no link | |
addition | additional parameter to <a tag (like "target=_blank") | |
f_t | converts text to html or escape html (due to html flag) | |
none | ||
f_s | print database field or default value if empty (the functionality of this alias function can be created as conditional f_c function as well) | |
default | default value (like "javascript: window.alert('No source url specified')") | |
f_l | prints field as link, if field_id in $param is defined, else prints just field | |
field_id | field_id of possible link (like "source_href.....") | |
f_e | http://actionapps.org/aa/admin/itemedit.php3?AA_CP_Session=f48237b26098d261a71de80ded1c49c4&edit=1&encap=false&id=6525acb6a0ceb34e3db375618efe19f0 used on admin page index.php3 for itemedit url | |
none | ||
f_c | prints "begin".field."end" if field="condition", else prints "none" if no cond_col specified - this $col is used condition can be reversed (negated) by "!" character at the begin of condition param: condition:begin:end:none:cond_col | |
condition | ||
begin | ||
end | ||
none | ||
cond_col | ||
Example: 1:Yes<!--:-->:No This example is usable for example for Highlight field - it shows Yes or No depending on highlight field | ||
Example: !:Email#::: If e-mail field is filled, it shows "Email: email@apc.org" (for example), but if it is not filled, it shows nothing | ||
f_u | calls user defined function (see How to create new aliases) | |
function | name of called function in include/usr_aliasfnc.php3 file | |
parameter | parameters passed to function | |
f_m | mailto link - prints: "begin<a href="(mailto:)$col">field/text</a>" if no $col is filled, prints "else_field/text" | |
begin | text before link (for example "e-mail") | |
field/text | if field id specified, the field is used as link text else the text is used insteed. | |
else_field/text | if no e-mail addres specified in $col, the field content (or text) is displayed | |
linktype | mailto / href (default is mailto) - it is possible to use this function for links, too - just type "href" as last parameter | |
i_s | image size and other properties - as default prints: 'height="xxx" width="yyy"', where xxx and yyy are the height and width of the image in pixels. Other properties can be printed as well.
Returns empty string if it cannot determine the width or height. |
|
information |
|
|
f_y | Expanded string: expands the string in the parameter.
If you need use aliases in a database field. It can be used e.g. for including photographs from the slice "Photogallery" to the field "full_text......." in the slice "Articles". See an Example. |
|
string to expand | If specified then this string is expanded, if not specified then expands the contents of the field. |
Last Edit: Aug 17 2011
<aafaq id=1768> ~ToDo: 1768 What are the Parameters of the Alias Functions </aafaq>
This FAQ interface was developed by Jason at Commons.ca
|
APC
ActionApps is a free software content management system initiated by
the Association for Progressive Communications (APC) APC - Internet and ICTs for social justice and development |