Enabling the XSLT extension for use in your XSLT templates.
Add the following XML snippet to your ~/config/xsltExtensions.config
file:
<XsltExtensions>
...
<ext assembly="uComponents.XsltExtensions" type="uComponents.XsltExtensions.Media" alias="ucomponents.media" />
...
</XsltExtensions>
Here are available methods in the Media
library:
Gets the media by CSV. Returns: Returns an XPathNodeIterator of the media nodes from the CSV list.
| Name | Type | Notes |
|——|——|——-|
| csv | System.String
| |
<xsl:value-of select="ucomponents.media:GetMediaByCsv(csv)" />
Gets the media by CSV. Returns: Returns an XPathNodeIterator of the media nodes from the CSV list.
| Name | Type | Notes |
|——|——|——-|
| csv | System.String
| |
| deep | System.Boolean
| |
<xsl:value-of select="ucomponents.media:GetMediaByCsv(csv, deep)" />
Gets the media item by it’s node name. Returns: Returns an XPathNodeIterator of the media nodes from specified node name.
| Name | Type | Notes |
|——|——|——-|
| nodeName | System.String
| |
<xsl:value-of select="ucomponents.media:GetMediaByName(nodeName)" />
Gets the media items by node type alias. Returns: Returns an XPathNodeIterator of the media nodes from specified node type alias.
| Name | Type | Notes |
|——|——|——-|
| nodeTypeAlias | System.String
| |
<xsl:value-of select="ucomponents.media:GetMediaByType(nodeTypeAlias)" />
Gets the media items by URL name. Returns: Returns an XPathNodeIterator of the media nodes from specified URL name.
| Name | Type | Notes |
|——|——|——-|
| urlName | System.String
| |
<xsl:value-of select="ucomponents.media:GetMediaByUrlName(urlName)" />
Gets the media items by an XPath expression. Returns: Returns an XPathNodeIterator of the media nodes from specified XPath expression.
| Name | Type | Notes |
|——|——|——-|
| xpath | System.String
| |
<xsl:value-of select="ucomponents.media:GetMediaByXPath(xpath)" />
Gets the media Id by URL. Returns: Returns the media Id.
| Name | Type | Notes |
|——|——|——-|
| url | System.String
| |
<xsl:value-of select="ucomponents.media:GetMediaIdByUrl(url)" />
Gets the published Xml. Returns: Returns an XPathNodeIterator of all the media nodes.
<xsl:value-of select="ucomponents.media:GetPublishedXml()" />
Gets the unique id of a media node. Returns: Returns the unique id of a media node.
| Name | Type | Notes |
|——|——|——-|
| mediaId | System.Int32
| |
<xsl:value-of select="ucomponents.media:GetUniqueId(mediaId)" />
Gets the HTML for an image tag, using the Media Id. Returns: Returns a HTML image tag from a Media Id.
| Name | Type | Notes |
|——|——|——-|
| mediaId | System.String
| |
<xsl:value-of select="ucomponents.media:GetImageHtml(mediaId)" />
Gets the HTML for an image tag, using the Media Id. Returns: Returns a HTML image tag from a Media Id.
| Name | Type | Notes |
|——|——|——-|
| mediaId | System.String
| |
| defaultHeight | System.Int32
| |
| defaultWidth | System.Int32
| |
<xsl:value-of select="ucomponents.media:GetImageHtml(mediaId, defaultHeight, defaultWidth)" />
Gets the height of the image. Returns: Returns the height of the image.
| Name | Type | Notes |
|——|——|——-|
| path | System.String
| |
<xsl:value-of select="ucomponents.media:GetImageHeight(path)" />
Gets the width of the image. Returns: Returns the width of the image.
| Name | Type | Notes |
|——|——|——-|
| path | System.String
| |
<xsl:value-of select="ucomponents.media:GetImageWidth(path)" />
Gets the height and width of the image. Returns: Returns the height and width of the image.
| Name | Type | Notes |
|——|——|——-|
| path | System.String
| |
| height | System.Int32@
| |
| width | System.Int32@
| |
<xsl:value-of select="ucomponents.media:GetImageHeightAndWidth(path, height, width)" />
Gets the size of the image. Returns: Returns the size (dimensions) of the image.
| Name | Type | Notes |
|——|——|——-|
| path | System.String
| |
<xsl:value-of select="ucomponents.media:GetImageSize(path)" />