IDs
The id tag transforms table IDs to their textual representations, using associated character columns, specifically the “Title” , “Name” and “Subject” ones. It has the following syntax:
[{table.id}]
...where table is the name of a Database table, and id the ID of an existing row in that table.
A few examples:
[{addon.2}] ➩ domain
[{hook.10}] ➩ Zoglair File Structure
[{phrase.582}] ➩ var.thumb.doc
[{sitemap.9}] ➩ Documentation
[{udf.282}] ➩ sessionTimeout
[{upload.1}] ➩ Domain Favicon
[{user.1}] ➩ zoglair
[{user}] ➩ Guest (current/active user)
In the case of the user table, the following additional specifiers are supported:
[{user_avatar.1}] ➩ 122
[{user_sevel.1}] ➩ 7
[{user_status.1}] ➩ 0
[{user_class.1}] ➩ offline sevel7
[{user_customTitle.1}] ➩ Bot
[{user_lastAccess.1}] ➩ 1426619802
[{user_createdOn.1}] ➩ 1285570880
Besides real tables, the following pseudo (~virtual) table names are also supported:
- date
Formats a timestamp as a “Y-m-d” date:
[{date.1329327419}] ➩ 2012-02-15
- time
Formats a timestamp as a “H:i:s” time:
[{time.1329327419}] ➩ 17:36:59
- dame
The above two, combined:
[{dame.1329327419}] ➩ 2012-02-15 17:36:59
- sevel
Outputs the following markup:
[{sevel.1}] ➩ <span class="sevel sevel1">1</span>
- path
Displays the path (breadcrumb) of the specified sitemap node id:
[{path.83}] ➩ User Guide » ZML » IDs
In the case of the time pseudo table, the following additional specifiers are supported:
[{time_when.1329327419}] ➩ 15 Feb 2012
[{time_age.100}] ➩ 53
[{time_span.1329327419-1129327419}] ➩ 6 years
Finally, nested parsing is supported for all expressions:
[{time_when.@user_lastAccess}] ➩ 17 Mar 2015
(in other words, instead of a numeric id, type @ followed by another expression)
This tag is mostly useful in HTML templates and phrase Molds. But, combining:
a) the ability to query the active user (without knowing his id), and
b) the ability to use nested parsing,
...you can come out with some interesting smart texts, too! (watch the last example)
|