This project has moved. For the latest updates, please go here.

Helpers

Graffiti Chalk supports .NET style helpers.

Listed below are the available helper types.

Byte
SByte
Int16
Int32
Int64
UInt16
UInt32
UInt64
Single
Double
Boolean
Char
Decimal
String
Guid
DateTime

Examples:

Get the current date and time:
$DateTime.Now 
Convert the string representation of a number to its 32-bit signed integer equivalent.
$Int32.Parse("123")
Convert the specified string representation of a date and time to its DateTime equivalent, in this case, a custom DateTime field, then find the date two days earlier.
$DateTime.Parse("$post.Custom("Event Date"))
Find the total number of days until (positive number of days) or since (negative number of days) a specified date, where the date is a string representation of a date and time.
$DateTime.Parse($post.Custom("Event Date")).Subtract($data.site.CurrentUserTime).TotalDays
Replace text within a string
#set ($newText = "Chalk is nice!")
#set ($newerText = $newText.replace("nice", "incredible"))
Replace the default input box contents on the Search widget.
$macros.Widget("Search", "<h3>","</h3>","<div>","</div>").replace("Search this site", "Search my blog")

Last edited Apr 7, 2010 at 5:09 PM by jkillebrew, version 3

Comments

No comments yet.