Function library for umbraco. Includes various helper-methods and methods to
save and load data from umbraco.
Especially usefull in XSLT where any of these methods can be accesed using the umbraco.library name-space. Example:
<xsl:value-of select="umbraco.library:NiceUrl(@id)"/>
The following tables list the members exposed by the library type.
Public Methods
| Name | Description | |
|---|---|---|
| ContextKey |
Get any value from the current Items collection.
| |
| CultureExists | ||
| CurrentDate |
Get the current date
| |
| DateAdd | Overloaded. | |
| DateDiff | ||
| DateGreaterThan |
Compare two dates
| |
| DateGreaterThanOrEqual |
Compare two dates
| |
| DateGreaterThanOrEqualToday |
Check if a date is greater than or equal today
| |
| DateGreaterThanToday |
Check if a date is greater than today
| |
| FormatDateTime | ||
| GetCurrentDomains |
Checks with the Assigned domains settings and retuns an array the the Domains matching the node
| |
| GetCurrentMember |
Get the current member as an xml node
| |
| GetDictionaryItem | ||
| GetDictionaryItems | ||
| GetHttpItem |
Get any value from the current Http Items collection
| |
| GetItem | Overloaded. | |
| GetMedia |
Get a media object as an xml object
| |
| GetMember |
Get a member as an xml object
| |
| GetMemberName |
Returns the Member Name from an umbraco member object
| |
| GetNodeFromLevel |
Helper function to get a value from a comma separated string. Usefull to get
a node identifier from a Page's path string
| |
| GetPreValueAsString | ||
| GetPreValues | ||
| GetPropertyTypeName |
Returns that name of a generic property
| |
| GetRandom | Overloaded. | |
| GetRelatedNodes | ||
| GetRelatedNodesAsXml | ||
| GetWeekDay |
Get the day of week from a date matching the current culture settings
| |
| GetXmlAll | ||
| GetXmlDocument | ||
| GetXmlDocumentByUrl | ||
| GetXmlNodeById | ||
| GetXmlNodeByXPath | ||
| GetXmlNodeCurrent | ||
| HasAccess |
Check if the current user has access to a document
| |
| IsLoggedOn |
Whether or not the current user is logged in (as a member)
| |
| IsProtected |
Check if a document object is protected by the "Protect Pages" functionality in umbraco
| |
| LastIndexOf | ||
| LongDate | Overloaded. | |
| LongDateWithDayName | ||
| NiceUrl |
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)
| |
| NiceUrlFullPath |
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
| |
| PageElement |
Returns any element from the currentpage including generic properties
| |
| PageId |
Returns the identifier of the current page
| |
| PageName |
Returns the title of the current page
| |
| PublishSingleNode |
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.
| |
| PublishSingleNodeDo |
Internal method that shouldn't be used (TODO: Check if it safely can be private)
Use umbraco.library.PublishSingleNode instead of this
| |
| PythonExecute |
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.
| |
| PythonExecuteFile |
Executes the given python script 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.
| |
| QueryForNode | ||
| RemoveFirstParagraphTag | ||
| RenderMacroContent | ||
| RenderTemplate | Overloaded. | |
| Replace | ||
| ReplaceLineBreaks | ||
| RePublishNodes | Obsolete.
Re-publishes all nodes under a given node
| |
| RePublishNodesDotNet | Overloaded. | |
| Request |
Get any value from the current Request collection. Please note that there also specialized methods for
Querystring, Form, Servervariables and Cookie collections
| |
| RequestCookies |
Get any value from the users cookie collection
| |
| RequestForm |
Get any value from the current Form collection
| |
| RequestQueryString |
Get any value from the current Querystring collection
| |
| RequestServerVariables |
Get any element from the server variables collection
| |
| SendMail |
Sends an e-mail using the System.Net.Mail.MailMessage object
| |
| Session |
Get any element from current user session
| |
| SessionId |
Returns the current ASP.NET session identifier
| |
| setSession |
Add a session variable to the current user
| |
| ShortDate | Overloaded. | |
| ShortDateWithGlobal | ||
| ShortDateWithTimeAndGlobal | ||
| ShortTime | ||
| Split |
Split a string into xml elements
| |
| StripHtml | ||
| Tidy | ||
| TruncateString |
Truncates a string if it's too long
| |
| UnPublishSingleNode |
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 propertyon the document object to false
| |
| UrlEncode |
Urlencodes a string
|
Public Fields
| Name | Description | |
|---|---|---|
| IsPublishing | ||
| NodesPublished | ||
| PublishStart |
Public Constructors
| Name | Description | |
|---|---|---|
| libraryNew | Overloaded. |