Base Tag Library
Note: We have updated our folder structure in Neto 6 and this has not been updated on all tweaks yet. More info.

format

Formats the content within the tag based on the tag parameters

Example

[%format type:'currency'%][@price@][%/format%]

Usage

Format tags are used manipulate the output of data created by Neto Template Tags. For example you can use format tags to change the way a date is displayed, trim a product name or change the case of a model number.

Printing the current time/date

The format tag allows you to print the current date / time by simply adding the word now within the tag, like so :

[%format type:'date' format:'#D #K #Y at #H:#I:#S'%]now[%/format%]

format Parameters

Name Options Description
type:'' date, text, number, percent, currency The type of format you wish to apply, each type has its own set of parameters that are specific to the type.
format:'' Code, see chart

Works with type date and determines the output of the date format

Short form
#dDay number
#kMonth name
#yYear
#mMonth number
#wDay name
#hHours
#iMinutes
#sSeconds
Long form
#DDay number
#KMonth name
#YYear
#MMonth number
#WDay name
#HHours
#IMinutes leading with 0
#SSeconds
#UUnix time
case:'' upper, lower Works with type text, forces the content to either be upper or lower case
maxlength:'' Integer Works with type text, limits the maximum amount of characters contained within the tag
wordlength:'' Integer Works with type text, limits the maximum amount of words contained within the tag
truemaxlength:'' Integer Works with type text, limits the maximum amount of characters contained within the tag after nohtml/rmhtml has been applied.
trim:'' e, l, r, a Works with type text, trims out spaces depending on the value used. l & r trim out spaces to the left and right respectively, a trims out all space between text and e trims out all space between text down to the interger attached to it, so for example, trim:'e1' will trim down to 1 space, removing the potential for double spaces.
nohtml:'' 1/0 Works with type text, when true it will not show HTML
rmhtml:'' 1/0 Works with type text, when true it will strip html
noeol:'' 1 Works with type text. Removes carriage returns from the text.
dp:'' Integer Works with type number, it will format the number to the specificed number of decimal places
pf:'' String Works with type number, appends the string specified as a prefix to the number formatted
tl:'' String Works with type number, adds the string specified to the end of the number formatted
sp:'' String Works with type number, adds the string specified at every thousand interval. Typically you would place a , here, so 10000 would be formatted as 10,000
tl_unit:'' String Works with type number, generates a text block based on the value, so if the item is singular ie. There is one, we might print the text "item has"
tl_plural:'' String Works with type number, generates a text block based on the value, so if the item is plural ie. There is two, we might print the text "items have"
dpno_zero:'' 0/1 Works with type currency, a boolean that when true will remove the decimal place if the cents value is 0 or 00
add:'' String Determine time value you would like to add to remove from current timeframe, example -1 Hour 1 day 5 min 2 month