Adds a reference to the jQuery javascript file from the client/ui folder using "jQuery" as a key Recommended to use instead of RegisterJavaScriptFile for all nitros/packages that uses jQuery
Changes the mime type of the current page.
Get any value from the current Items collection.
Returns: A string with the value of the Items element
Checks whether the Culture with the specified name exixts in the standard .net cultureInfo.
Get the current date
Returns: Current date i xml format (ToString("s"))
Add a value to a date
Returns: A date in xml format (ToString("s"))
Add a value to a date. Similar to the other overload, but uses a datetime object instead of a string
Returns: A date in xml format (ToString("s"))
Return the difference between 2 dates, in either minutes, seconds or years.
Returns: A timespan as a integer
Compare two dates
Returns: True if the first date is greater than the second date
Compare two dates
Returns: True if the first date is greater than or equal the second date
Check if a date is greater than or equal today
Returns: True if the date is greater that or equal today (ie. at least today or the day of tomorrow)
Check if a date is greater than today
Returns: True if the date is greater that today (ie. at least the day of tomorrow)
Formats a string to the specified formate.
Returns: A date in the new format as a string
Checks with the Assigned domains settings and retuns an array the the Domains matching the node
Returns: A Domain array with all the Domains that matches the nodeId
Get the current member as an xml node
Returns: Look in documentation for umbraco.library.GetMember(MemberId) for more information
Gets the dictionary item with the specified key.
Returns: A dictionary items value as a string.
Gets the dictionary item with the specified key and it's child dictionary items. The language version is based on the culture of the current Url.
Returns: A XpathNodeIterator in the format: [dictionaryItemValue]
Get any value from the current Http Items collection
Returns: A string with the value of the Requested element
Returns a string with the data from the given element of a node. Both elements (data-fields) and properties can be used - ie: getItem(1, nodeName) will return a string with the name of the node with id=1 even though nodeName is a property and not an element (data-field).
Returns: Returns a string with the data from the given element of a node
Returns a string with the data from the given element of the current node. Both elements (data-fields) and properties can be used - ie: getItem(nodeName) will return a string with the name of the current node/page even though nodeName is a property and not an element (data-field).
Get a media object as an xml object
Returns: An umbraco xml node of the media (same format as a document node)
Get a member as an xml object
Returns: An umbraco xml node of the member (same format as a document node), but with two additional attributes on the "node" element: "email" and "loginName".
Returns the Member Name from an umbraco member object
Returns: The Member name matching the MemberId, an empty string is member isn't found
Helper function to get a value from a comma separated string. Usefull to get a node identifier from a Page's path string
Returns: A string with the value of the index
Gets the umbraco data type prevalue with the specified Id as string.
Returns: Returns the prevalue as a string
Gets the prevalues from a umbraco DataType with the specified data type id.
Returns: Returns the prevalues as a XPathNodeIterator in the format: [value]
Returns that name of a generic property
Returns: A string with the name. If nothing matches the alias, an empty string is returned
These random methods are from Eli Robillards blog - kudos for the work :-) http://weblogs.asp.net/erobillard/archive/2004/05/06/127374.aspx Get a Random object which is cached between requests. The advantage over creating the object locally is that the .Next call will always return a new value. If creating several times locally with a generated seed (like millisecond ticks), the same number can be returned.
Returns: A Random object which is cached between calls.
GetRandom with no parameters.
Returns: A Random object which is cached between calls.
Gets the related nodes, of the node with the specified Id, as XML.
Returns: The related nodes as a XpathNodeIterator in the format: [standard umbraco node Xml]
Returns a new UmbracoHelper so that we can start moving the logic from some of these methods to it
Get the day of week from a date matching the current culture settings
Returns: A string with the DayOfWeek matching the current contexts culture settings
Gets the entire umbraco xml cache.
Returns: Returns the entire umbraco Xml cache as a XPathNodeIterator
Fetches a xml file from the specified path on the server. The path can be relative ("/path/to/file.xml") or absolute ("c:\folder\file.xml")
Returns: The xml file as a XpathNodeIterator
Fetches a xml file from the specified url. the Url can be a local url or even from a remote server.
Returns: The xml file as a XpathNodeIterator
Gets the XML document by URL Cached.
Gets the page with the specified id.
Returns: Returns the node with the specified id as xml in the form of a XPathNodeIterator
Queries the umbraco Xml cache with the specified Xpath query
Returns: Returns nodes matching the xpath query as a XpathNodeIterator
Gets the current page.
Returns: An XpathNodeIterator containing the current page as Xml.
Check if the current user has access to a document
Returns: True if the current user has access or if the current document isn't protected
HTML-encodes a string
Returns: A HTML-encoded string
Whether or not the current user is logged in (as a member)
Returns: True is the current user is logged in
Check if a document object is protected by the "Protect Pages" functionality in umbraco
Returns: True if the document object is protected
Creates an Umbraco item for the specified field of the specified node. This brings the umbraco:Item element functionality to XSLT documents, which enables Live Editing of XSLT generated content.
Returns: An Umbraco item.
Creates an Umbraco item for the specified field of the specified node. This brings the umbraco:Item element functionality to XSLT documents, which enables Live Editing of XSLT generated content.
Returns: An Umbraco item.
This will convert a json structure to xml for use in xslt
Returns the Last index of the specified value
Returns: Return the last index of a value as a integer
Converts a string to Long Date and returns it as a string
Returns: A Long Date as a string.
Converts a string to a Long Date and returns it as a string
Returns: A Long Date as a string.
Converts a string to datetime in the longdate with day name format.
Returns: A datetime in the longdate formate with day name, as a string
Returns a string with a friendly url from a node. IE.: Instead of having /482 (id) as an url, you can have /screenshots/developer/macros (spoken url)
Returns: String with a friendly url from a node
<a href="{umbraco.library:NiceUrl(@id)}">Link</a>
This method will always add the root node to the path. You should always use NiceUrl, as that is the only one who checks for toplevel node settings in the web.config
Returns: String with a friendly url from a node
This method will always add the domain to the path if the hostnames are set up correctly.
Returns: String with a friendly url with full domain from a node
This method will always add the domain to the path.
Returns: String with a friendly url with full domain from a node
Returns any element from the currentpage including generic properties
Returns: A string with the element value
Returns the identifier of the current page
Returns: The identifier of the current page
Returns the title of the current page
Returns: The title of the current page
Publishes the single node, this method is obsolete
Executes the given python expression and returns the standardoutput. The Globals known from python macros are not accessible in this context. Neighter macro or page nor the globals known from python macros are accessible in this context. Only stuff we initialized in site.py can be used.
Returns: Returns the StandardOutput
Executes the given python script and returns the standardoutput. The Globals known from python macros are not accessible in this context. Neither macro or page nor the globals known from python macros are accessible in this context. Only stuff we initialized in site.py can be used.
Returns: Returns the StandardOutput
Returns the Xpath query for a node with the specified id
Returns: The Xpath query for the node with the specified id as a string
Re-publishes all nodes under a given node
Re-publishes all nodes under a given node
Refreshes the runtime xml index. Note: This *doesn't* mark any non-published document objects as published
Refreshes the xml cache for all nodes
Registers the client script block.
Registers the client script include.
Registers the client script include.
Removes the starting and ending paragraph tags in a string.
Returns: Returns the string without starting and endning paragraph tags
Renders the content of a macro. Uses the normal template umbraco macro markup as input. This only works properly with xslt macros. Python and .ascx based macros will not render properly, as viewstate is not included.
Returns: The rendered macro as a string
Renders a template.
Returns: The rendered template as a string
Renders the default template for a specific page.
Returns: The rendered template as a string.
Replaces a specified value with a new one.
Replaces text line breaks with html line breaks
Returns: The text with text line breaks replaced with html linebreaks ()
Get any value from the current Request collection. Please note that there also specialized methods for Querystring, Form, Servervariables and Cookie collections
Returns: A string with the value of the Requested element
Get any value from the users cookie collection
Returns: A string with the value of the cookie
Get any value from the current Form collection
Returns: A string with the value of the form element
Get any value from the current Querystring collection
Returns: A string with the value of the querystring element
Get any element from the server variables collection
Returns: A string with the value of the requested element
Sends an e-mail using the System.Net.Mail.MailMessage object
Get any element from current user session
Returns: A string with the value of the requested element
Returns the current ASP.NET session identifier
Returns: The current ASP.NET session identifier
Converts a string to a Short Date and returns it as a string
Returns: A Short Date as a string.
Converts a datetime string to the ShortDate format.
Converts a string to a Short Date, with a specific culture, and returns it as a string
Returns: A short date with a specific culture, as a string
Converts a string to a Short Date with time, with a specific culture, and returns it as a string
Returns: A short date withi time, with a specific culture, as a string
Converts a datetime string to the ShortTime format.
Split a string into xml elements
Returns: An XPathNodeIterator containing the substrings in the format of
Strips all html from a string.
Returns: Returns the string without any html tags.
Cleans the spified string with tidy
Truncates a string if it's too long
Returns: A truncated string if text if longer than MaxLength appended with the addString parameters. If text is shorter then MaxLength then the full - non-truncated - string is returned
Unpublish a node, by removing it from the runtime xml index. Note, prior to this the Document should be marked unpublished by setting the publish property on the document object to false
Publishes a Document by adding it to the runtime xml index. Note, prior to this the Document should be marked published by calling Publish(User u) on the document object.
URL-encodes a string
Returns: A URL-encoded string
Returns an MD5 hash of the string specified
Returns: Md5 has of the string
Add a cookie variable to the current user
Add a session variable to the current user