This setup enables me to develop Umbraco macros locally on OS X, by mocking the commonly used
extensions in the urn:umbraco.library
and urn:ucomponents.*
namespaces.
It works by using a cunning and award-winning (yes, I wish) trick that makes the local file import the mocks, but leaves the remote file untouched.
The actual mocks are written as simple EXSLT functions that either mimic the corresponding library function, or just makes sure to return something that looks like a duck.
-
CurrentDate()
-
DateAdd()
-
DateGreaterThanOrEqual()
-
DateGreaterThanOrEqualToday()
-
FormatDateTime()
-
GetMedia()
-
GetXmlNodeById()
-
HasAccess()
-
IsLoggedOn()
-
NiceUrl()
-
Replace()
-
RequestQueryString()
-
RequestServerVariables()
-
Split()
-
GetRandomNumbersAsXml()
(random) -
RandomChildNode()
(xml)
(Unchecked items are extensions that have an empty stub in the file, but no real implementation yet.)
Here is the reference for the umbraco.library functions on Our Umbraco.
Here is the reference for the uComponents Extensions on ucomponents.org
To install these, just copy the mocks
folder into your xslt
folder OR... you can use this super-handy link to get a couple of nifty Terminal commands (who doesn't love those?):