Reference - Transformation methods
This reference provides information about the default methods specifically designed for use in transformations:
- Data loading
- Boolean operations
- URLs and page links
- Text manipulation
- Images
- E-commerce
- Membership and community
- Date & time
- Smart search
- Syndication (RSS, Atom, XML)
- Microsoft SharePoint
- Placeholders for sublevels in hierarchical data
- Editing buttons for pages displayed by listing web parts
Important
The listed methods are available for both ASCX and Text / XML transformations (the examples are in ASCX format).
For Text / XML transformations, use macro method equivalents with identical signatures. If you encounter problems, use the macro autocomplete help to find information about potential syntax differences.
Note that the transformation methods are not available for macros that are processed by external applications displaying MVC sites (for example when resolving macros in email templates for e-commerce email notifications sent as a reaction to orders made on the live site).
Notes
- All transformation methods return string values (unless otherwise specified).
- In addition to the listed method, ASCX transformations allow you to call any type of inline code, including ASP.NET system methods, Kentico API or custom API.
- For Text / XML transformations, you can also use general macro methods. See: Reference - Macro methods
Data loading
Method |
Parameters |
Description and examples |
Eval |
|
Loads the value from the specified column of the transformed object’s data. Returns the value as an object data type. Use only for ASCX transformations. The optional boolean parameter specifies whether the method HTML encodes the loaded value. When not specified, the encoding depends on the value of the CMSHTMLEncodeEval web.config key (false by default). <%# Eval(“NewsTitle”) %> |
Eval<ReturnType> |
|
Loads the value from a column of the transformed object’s data, and returns it as an object of the specified type. Use only for ASCX transformations. <%# Eval<string>(“NodeAliasPath”) %> |
EvalCDATA |
|
Loads the value from the specified column of the transformed object’s data and escapes all occurrences of the ]]> sequence in the returned string. Depending on the optional boolean parameter (true by default), the method wraps the whole string in the <![CDATA[“wrapped text”]]> enclosure. <%# EvalCDATA(“NewsText”) %> |
EvalJSString |
|
Loads the value from the specified column of the transformed object’s data. Encodes the returned text to be used in JavaScript code and encapsulates it into ’ characters. |
GetEditableValue |
|
Loads the content of an editable region on the page. Specify the region using the control ID (web part control ID). <%# GetEditableValue(“mainText”) %> |
GetNotEmpty |
|
Returns the value of the first data column that is not empty or null. The parameter must provide a list of column names separated by semicolons. <%# GetNotEmpty(“FullName;UserName”) %> |
GetColumnName |
|
Returns the value of the first column that is present in the data of the transformed object. The parameter must provide a list of column names separated by semicolons. By default, the method only returns columns that are not null or empty. Set the optional second parameter to true to allow empty values. |
Property |
Description and examples |
DataItem |
Gets the currently transformed data item. <%# DataItem %> |
DataItemIndex |
Gets the data item index for the current transformation container. You have to use Container.DataItemIndex to get the index in the current binding context. <%# DataItemIndex %> |
DataItemCount |
Gets the total number of data items in the current transformation container. If pagination is used, the DataItemCount returns the number of items on the current page. <%# DataItemCount %> |
DataRowView |
Gets a DataRowView of the transformed record’s data. <%# DataRowView[“UserName”] %> |
DisplayIndex |
Gets the current position of the data item as displayed in a control. <%# DisplayIndex %> |
DocumentCustomData |
Gets the value of custom page data fields (culture specific). Use the [“nodename”] notation to retrieve data stored in the specified node of the XML. See also: Storing custom data for all page types <%# DocumentCustomData[“myproperty”] %> |
EditableItems |
Gets the content of the specified editable region on the page. <%# EditableItems[“mainText”] %> |
NodeCustomData |
Gets the value of custom page data fields (shared for all culture versions). Use the [“nodename”] notation to retrieve data stored in the specified node of the XML. See also: Storing custom data for all page types <%# NodeCustomData[“myproperty”] %> |
> Back to the list of transformation method categories
Boolean operations
Method |
Parameters |
Description and examples |
If |
|
Returns a result according to the boolean value of the first parameter. <%# If(Eval(“IsSecuredNode”), “The page requires authentication”, “The page is publicly available”) %> |
IfCompare |
|
Compares the values of the first and the second parameter.
<%# IfCompare(1, 2, “The values are different”, “The values are equal”) %> |
IfEmpty |
|
Checks for emptiness of the value in the first parameter.
<%# IfEmpty(Eval(“ProductPhoto”), “No image”, GetImage(“ProductPhoto”)) %> |
IfTrue |
|
Checks whether the first parameter contains a true boolean value.
|
IsFirst |
- |
Returns a true value if the transformed data item is the first in the provided data. If pagination is used, the method returns a true value for the first item on the current page. <%# IsFirst() %> |
IsLast |
- |
Returns a true value if the transformed data item is the last in the provided data. If pagination is used, the method returns a true value for the last item on the current page. <%# IsLast() %> |
IsCurrentDocument |
- |
Returns a true value if the transformed page is equal to the page where the transformation is being displayed. <%# IsCurrentDocument() %> |
IsDocumentOnSelectedPath |
- |
Returns a true value if the transformed page is present on the alias path of the page where the transformation is being displayed (i.e. if the transformed page is an ancestor of the current page). <%# IsDocumentOnSelectedPath() %> |
> Back to the list of transformation method categories
URLs and page links
Method |
Parameters |
Description and examples |
GetAbsoluteUrl |
|
Converts relative URLs to absolute URLs. You can specify the target domain name in the absolute URL using either a site ID, site code name or explicitly. If you leave all optional parameters empty, the method generates the absolute URL using the domain of the current site. <%# GetAbsoluteUrl(“~/Home.aspx”) %> |
GetAttachmentIcon |
|
Returns the attachment file type icon according to the extension of the file identified by the given GUID column. <%# GetAttachmentIcon(“AttachmentGUID”) %> |
GetAttachmentUrl |
|
Returns the URL of the attachment file specified by name in the first parameter, loaded from the page whose alias path matches the second parameter. For example, you can use the method for working with grouped and unsorted attachments. You can optionally generate a URL for an image variant of the attachment by specifying an image variant definition identifier. The method returns the same URL as the GetAttachmentUrlByDocumentId method, but without loading the whole page, which results in better performance. <%# GetAttachmentUrl(Eval(“AttachmentName”), Eval(“NodeAliasPath”)) %> |
GetAttachmentUrlByDocumentId |
|
Returns the URL of the attachment file specified by name in the first parameter, loaded from the page whose ID matches the second parameter. You can optionally generate a URL for an image variant of the attachment by specifying an image variant definition identifier. <%# GetAttachmentUrlByDocumentId(Eval(“AttachmentFileName”), Eval(“AttachmentDocumentID”)) %> |
GetAttachmentUrlByGUID |
|
Returns the URL of the attachment file specified by an attachment GUID value. You can optionally generate a URL for an image variant of the attachment by specifying an image variant definition identifier. The method’s file name parameter does not have to correspond with the real file name. <%# GetAttachmentUrlByGUID(Eval(“AttachmentGUIDColumn”), “<custom_file_name>”) %> |
GetDocumentLink |
|
Returns a HTML link (<a> tag) that leads to the transformed page. By default, the method HTML encodes the page name in the link title. Set the optional parameter to false to disable the encoding. <%# GetDocumentLink() %> |
GetDocumentUrl |
Returns the URL of the specified page. The method does not evaluate custom URL extensions set for the page. <%# GetDocumentUrl() %> |
|
GetDocumentUrlById |
|
Returns the URL of the specified page. The method evaluates custom URL extensions set for the page if the system is set to use extensionless URLs. <%# GetDocumentUrlById(Eval(“DocumentID”)) %> |
GetDocumentUrlByGUID |
|
Returns a permanent URL of the specified page (with the NodeGUID in the query string). <%# GetDocumentUrlByGUID(Eval(“NodeGUID”), Eval(“NodeAlias”)) %> |
GetFileIcon |
|
Returns an <i> tag displaying a font icon that represents the MIME type of the specified file extension. <%# GetFileIcon(Eval(“DocumentExtensions”)) %> |
GetFileIconClass |
|
Returns the name of a CSS class, which you can use to display font icons representing the MIME type of the specified file extension. Assign the class to an <i> tag to display the icon. <i class=“<%# GetFileIconClass(Eval<string>(”DocumentExtensions”)) %>“></i> |
GetForumPostUrl |
|
Returns the URL of the forum post specified by the path in the first parameter, from the forum specified by the identifier in the second parameter. <%# GetForumPostUrl(Eval(“PostIDPath”), Eval(“ForumID”)) %> |
GetMediaFileUrl |
|
Returns the URL of the specified media file. The media file is specified by the file GUID in the first parameter and the file name in the second parameter. <%# GetMediaFileUrl(Eval(“FileGUID”), Eval(“FileName”)) %> Note: GetMediaFileUrl requires different parameters when used as a macro method for Text / XML transformations:
For example: {% GetMediaFileUrl(FileLibraryID, FilePath, FileGuid, FileName, true) %} |
GetMetaFileUrl |
|
Returns the URL of the specified meta file. The file is specified by the file GUID in the first parameter and the file name in the second parameter. |
GetNavigationUrl |
Returns a resolved (absolute) URL of the page that’s currently being processed. The resulting URL is not encoded. The method reflects page navigation settings, such as URL redirection, and Redirect to first child. <%# GetNavigationUrl() %> |
|
GetUrl |
|
Returns the URL of the page specified by the alias path in the first parameter or the URL path in the second parameter. <%# GetUrl(Eval(“NodeAliasPath”), Eval(“DocumentUrlPath”)) %> |
> Back to the list of transformation method categories
Text manipulation
Method |
Parameters |
Description and examples |
EnsureMaximumLineLength |
|
Allows you to insert line breaks into long sequences of characters without whitespace (such as URLs). The method places the line break after the number of characters specified by the second parameter. <%# EnsureMaximumLineLength(“VeryLongStringWithoutAnyBlankSpaces”, 21) %> |
HTMLEncode |
|
Encodes HTML tags in the specified text. <%# HTMLEncode(“Sample text <br />”) %> |
LimitLength |
|
Limits text to the length specified in the second parameter. The third parameter is the trimming suffix, i.e. the string appended to the end of shortened strings. The suffix is included in the maximum length. For example, if you use the “…” suffix and a maximum length of 100 characters, the returned string contains the first 97 characters of the original string, followed by an ellipsis. Set the last parameter to true to avoid trimming in the middle of words. <%# LimitLength(“Example of long text”, 10 , “…”, true) %> |
Localize |
|
Resolves all localization expressions inside the specified text. |
RemoveDiscussionMacros |
|
Removes all BBCode tags from the provided text. <%# RemoveDiscussionMacros(“[quote]Sample text[/quote]”) %> |
RemoveDynamicControls |
|
Removes all controls from the specified text (such as inline widgets). <%# RemoveDynamicControls(Eval(“NewsText”) ) %> |
StripTags |
|
Completely removes HTML tags from the specified text. <%# StripTags(“Sample text <br />”) %> |
> Back to the list of transformation method categories
Images
Method |
Parameters |
Description and examples |
GetEditableImage |
|
Returns an image tag that displays the content of an editable image control or web part on the page. Specify the editable image using the control ID (web part control ID). <%# GetEditableValue(“mainImage”) %> |
GetEditableImageUrl |
|
Returns the URL of the image selected inside the specified editable image control or web part. Specify the editable image using the control ID (web part control ID). <%# GetEditableImageUrl(“mainImage”) %> |
GetImage |
|
Returns an image tag that displays the image file whose GUID is stored in the specified column of the transformed object’s data. <%# GetImage(“NewsTeaser”) %> |
GetImageByUrl |
|
Returns an image tag that displays the image stored under the specified URL. <%# GetImageByUrl(“~/Images/Image1.aspx”) %> |
IfImage |
|
Checks whether the page attachment specified by the GUID in the first parameter is an image file. If the file is an image, the method returns the value of the second parameter, otherwise the value of the third parameter. <%# IfImage(“NewsTeaser”, “The file is an image”, “The file is not an image”) %> |
> Back to the list of transformation method categories
E-commerce
SKU price
Method |
Parameters |
Description and examples |
GetSKUPrice |
- |
Returns an SKU price based on the SKU data and the data of the current shopping cart. The price includes any catalog discounts that apply. To display the list price of a product, use the GetSKUListPrice method. <%# GetSKUPrice() %> |
GetSKUFormattedPrice |
- |
Returns a formatted SKU price based on the SKU data and the data of the current shopping cart. The price includes any catalog discounts that apply. To display the formatted list price of a product, use the GetSKUFormattedListPrice method. <%# GetSKUFormattedPrice() %> |
GetSKUListPrice |
- |
Returns an SKU list price based on the SKU data and the data of the current shopping cart. The list price is loaded from the SKURetailPrice column. <%# GetSKUListPrice() %> |
GetSKUFormattedListPrice |
- |
Returns a formatted SKU list price based on the SKU data and the data of the current shopping cart. The list price is loaded from the SKURetailPrice column. <%# GetSKUFormattedListPrice() %> |
GetSKUOriginalPrice |
- |
Returns the greater of the following SKU price options:
If both prices are equal to the standard product price with discounts (i.e. the product’s list price is equal to the price and no discounts apply), the method returns 0. <%# GetSKUOriginalPrice() %> |
GetSKUFormattedOriginalPrice |
- |
Returns the greater of the following SKU price options and formats the result according to the currency used in the current shopping cart:
If both prices are equal to the standard product price with discounts (i.e. the product’s list price is equal to the price and no discounts apply), the method returns 0. <%# GetSKUFormattedOriginalPrice() %> |
GetSKUPriceSaving |
|
Returns the amount of money saved on the price of the processed SKU, as a percentage or in the currency of the current shopping cart. The savings are calculated based on the difference between the product’s price (from the SKUPrice column, including any catalog discounts that apply) and the greater of the following options:
If the product’s price is greater than the list price and no discounts apply, the method returns 0. The optional bool percentage parameter determines whether the result is returned as a percentage. By default the value is false, which means the result is returned in the currency of the current shopping cart. <%# GetSKUPriceSaving(true) %> |
GetSKUFormattedPriceSaving |
- |
Returns the amount of money saved on the price of the processed SKU and formats the result according to the currency used in the current shopping cart. The savings are calculated based on the difference between the product’s price (from the SKUPrice column, including any catalog discounts that apply) and the greater of the following options:
If the product’s price is greater than the list price and no discounts apply, the method returns 0. <%# GetSKUFormattedPriceSaving() %> |
GetSKUTax |
- |
Depending on the site’s Prices include tax setting, returns either:
For example:
<%# GetSKUTax() %> |
GetFormattedSKUTax |
- |
Displays a tax value for the processed SKU and formats the result according to the currency used in the current shopping cart. Depending on the site’s Prices include tax setting, returns either:
<%# GetFormattedSKUTax() %> |
SKU price formatting
Method |
Parameters |
Description and examples |
ApplyExchangeRate |
|
Returns the specified price (decimal price) in the currency of the current user’s shopping cart and then converts the value into the current site’s main currency (according to the configured exchange rates). <%# ApplyExchangeRate(100) %> |
FormatPrice |
|
Returns the specified price (decimal price) formatted according to the currency of the current user’s shopping cart. The method does not work in contexts where the current shopping cart is not available.
<%# FormatPrice(100, true) %> |
SKU properties
Method |
Parameters |
Description and examples |
GetSKUIndicatorProperty |
|
Returns a value from the specified column (string column) of the public status assigned to the transformed product. Commonly used public status columns are PublicStatusDisplayName and PublicStatusName. If the product is evaluated as a new product, the public status is determined by thePublic status for ’new products’setting. <%# GetSKUIndicatorProperty(“PublicStatusDisplayName”) %> |
IsSKUAvailableForSale |
- |
Returns whether the given SKU can be bought by customers on the live site based on the properties of the SKU. <%# IsSKUAvailableForSale() %> |
IsSKUInStock |
- |
Returns whether the given SKU is available or not based on the stock amountproperty of the SKU. <%# IsSKUInStock() %> |
GetSKUNodeAlias |
- |
Returns the node alias of the given SKU. If there are multiple nodes for the SKU, the first occurrence is returned. If there is not any node for the SKU, an empty string is returned. <%# GetSKUNodeAlias() %> |
URLs
Method |
Parameters |
Description and examples |
GetSKUUrl |
- |
Returns the user-friendly permanent URL of the SKU. <%# GetSKUUrl() %> |
GetProductUrl |
|
Returns the user-friendly URL of the product specified by the GUID (object skuGuid) and name (object skuName) of the product on the specified site (object siteName). If you do not specify the site name, the system uses the current site. <%# GetProductUrl(Eval(“SkuGuid”), Eval(“SkuName”), Eval(“SiteName”)) %> |
GetProductUrlById |
|
Returns the user-friendly URL of the product specified by the ID (object skuID) and name (object skuName) of the product on the specified site (object siteName). If you do not specify the site name, the system uses the current site. <%# GetProductUrlByID(Eval(“SkuID”), Eval(“SkuName”), Eval(“SiteName”)) %> |
GetProductUrlForFeed |
|
Returns the URL of the specified product (object skuGUID) with the specified name (object skuName) with the feed query string parameter in the URL for the feed on the specified site (object siteName). If you do not specify the site name, the system uses the current site. <%# GetProductUrlForFeed(Eval(“SkuGuid”), Eval(“SkuName”), Eval(“SiteName”)) %> |
GetSKUImageUrl |
OR
|
Returns the URL of the product image. Specify the required width (object width) and height (object height) of the image, or the maximum side width of the image (object maxsidesize). If the product image is not specified, the URL of the default product image is returned. <%# GetSKUImageUrl(200, 300) %> |
Discounts
Method |
Parameters |
Description and examples |
GetDiscountCouponCodeRemoveButton |
|
Available for transformations displaying coupon code items using the Coupon codes web part. Generates an <input> element (of the submit type) that removes the specified coupon code from the shopping cart when clicked. <%# GetDiscountCouponCodeRemoveButton(Eval<string>(“Code”), “btn”) %> |
GetMultiBuyDiscountNames |
- |
Available for transformations displaying shopping cart items (for example using the Shopping cart content web part). Returns the names and price values of Buy X Get Y discounts and Product coupons applied to the current shopping cart item, enclosed within li HTML tags. <%# GetMultiBuyDiscountNames() %> |
Google tag manager product data
Method |
Parameters |
Description and examples |
GetGtmProductJson |
|
Returns a JSON string containing the data of the transformed product (SKU), in a format suitable for use with the Google Tag Manager and Universal Analytics Enhanced Ecommerce features. For more information, see Integrating Google Analytics Enhanced Ecommerce. The optional additionalData parameter allows you to extend the returned JSON string (custom fields and values). The optional purpose parameter can be processed in code customizations of the product data creation process, if you need to return different JSON data for various scenarios. <%# GetGtmProductJson(“{ ‘list’ : ‘Search Results’}”, “searchImpressions”) %> |
> Back to the list of transformation method categories
Membership and community
Method |
Parameters |
Description and examples |
GetAge |
|
Returns age calculated according to the date of birth given in the first parameter. If the date of birth is not available, the method returns the string specified in the second parameter. <%# GetAge(Eval(“UserDateOfBirth”),“Unknown age”) %> |
GetBadgeImage |
|
Returns an image tag that displays the specified user badge. <%# GetBadgeImage(Eval<int>(“UserBadgeID”)) %> |
GetBadgeName |
|
Returns the display name of the specified badge. <%# GetBadgeName(Eval<int>(“UserBadgeID”)) %> |
GetGender |
|
Returns the gender of users according to the value specified in the parameter. Load the value from the user’s gender field.
<%# GetGender(Eval(“UserGender”)) %> |
GetGroupAvatarImage |
|
Returns an image tag that displays the avatar of a group. The group is either identified automatically using the AvatarGuid field of the transformed group, or you can optionally specify an identifier value using the first parameter. <%# GetGroupAvatarImage(200, “Alternate text”) %> |
GetGroupProfileUrl |
|
Returns the URL of the specified group’s profile page. <%# GetGroupProfileUrl(Eval(“GroupName”) %> |
GetMemberProfileUrl |
|
Returns the URL of the user profile page for the specified group member. <%# GetMemberProfileUrl(Eval(“UserName”)) %> |
GetUserAvatarImage |
|
Returns an image tag that displays the avatar of a user. The user is either identified automatically using the AvatarGuid field of the transformed user, or you can specify either an avatar identifier or user identifier. <%# GetUserAvatarImage(200, “Alternate text”) %> |
GetUserAvatarImageUrl |
|
Returns the URL of the specified user’s avatar image. If the user does not have an avatar, the method returns the URL of the default avatar image. <%# GetUserAvatarImageUrl(Eval(“UserAvatarID”), Eval(“UserID”), 200, 150, 150) %> |
GetUserFullName |
|
Returns the full name of the specified user. <%# GetUserFullName(Eval<int>(“UserID”)) %> |
GetUserProfileUrl |
|
Returns the URL of the user profile page for the specified user. <%# GetUserProfileURL(Eval(“UserName”)) %> |
TrimSitePrefix |
|
Removes the site prefix from user names (if site prefixes are enabled in Settings -> Security & Membership -> Use site prefix for user names). |
> Back to the list of transformation method categories
Date & time
Method |
Parameters |
Description and examples |
FormatDate |
|
Displays the specified date without the time component. The method automatically formats the date according to the current culture. <%# FormatDate(DateTime.Now) %> |
FormatDateTime |
|
Displays the date and time value according to a format string. The method formats the date and time according to the current culture. <%# FormatDateTime(DateTime.Now, “MM/dd/yyyy HH:mm”) %> |
GetDate |
|
Loads a date value from the specified field of the transformed object’s data. <%# GetDate(“NewsReleaseDate”) %> |
GetDateTime |
|
Loads a date and time value from the specified field of the transformed object’s data. The value uses the time zone set for the server. Optionally, you can format the date and time value according to a format string. <%# GetDateTime(“NewsReleaseDate”) %> |
GetCustomDateTime |
|
Converts a date and time value to the specified time zone. <%# GetCustomDateTime(DateTime.Now, “GreenwichMeanTime”) %> |
GetDateTimeString |
|
Converts the specified date and time value to the time zone set for the server. The second parameter determines whether the displayed date and time has a tooltip. <%# GetDateTimeString(“NewsReleaseDate”, true) %> |
GetSiteDateTime |
|
Converts the specified date and time value to the current site’s time zone. <%# GetSiteDateTime(Eval(“NewsReleaseDate”)) %> |
GetUserDateTime |
|
Converts the specified date and time value to the time zone set for the user viewing the page. <%# GetUserDateTime(Eval(“NewsReleaseDate”)) %> |
> Back to the list of transformation method categories
Smart search
See Setting up search on your website for more information.
Method |
Parameters |
Description and examples |
SearchResultUrl |
|
Returns the URL of the page containing the details of the search result.
<%# SearchResultUrl(true, false) %> Note: The SearchResultUrl method does not return valid URLs for search results produced by general indexes, since the indexed objects are not pages and there is no default page to display the object details. You need to write and use a custom transformation method to generate the correct URL of a custom page displaying the appropriate information. Combine with default culture When the Combine with default culture setting is enabled, visitors will see pages in the default culture if they aren’t translated to their current culture.
|
SearchHighlight |
|
Wraps the text of the first parameter into the tags specified by the other two parameters. <%# SearchHighlight(SearchResultUrl(),“<strong>”,“</strong>”)%> |
GetSearchImageUrl |
|
Returns the URL of the current search result’s image. The first parameter specifies the URL used if no image is found – enter either the full relative path starting from the application root (~/), or a partial path starting from the ~/App_Themes/<skin_folder>/Images/ directory. The second parameter specifies the maximum side size to which the method resizes the image. <%# GetSearchImageUrl(“~/App_Themes/Default/Images/CMSModules/CMS_SmartSearch/no_image.gif”, 90) %> <%# GetSearchImageUrl(“/CMSModules/CMS_SmartSearch/no_image.gif”, 90) %> |
GetSearchValue |
|
Returns the value of the specified field for the current search result. Allows you to access both the general fields of the given objects type (page, custom table etc.) and any other fields included in the search index. <%# GetSearchValue(“DocumentName”) %> |
GetSearchedContent |
|
Parses the searched content as XML if required, and removes dynamic controls and macro expressions. |
> Back to the list of transformation method categories
Syndication (RSS, Atom, XML)
See also: Setting up syndication feeds
Method |
Parameters |
Description and examples |
GetAtomDateTime |
|
Returns the specified date and time value in a format suitable for Atom feeds (according to RFC 3339). <%# GetAtomDateTime(Eval(“DocumentCreatedWhen”)) %> |
GetRSSDateTime |
|
Returns the specified date and time value in a format suitable for RSS feeds (according to RFC 882). <%# GetRSSDateTime(Eval(“DocumentCreatedWhen”)) %> |
GetBlogCommentUrlForFeed |
|
Returns the URL of the comments added to the blog post specified by a page identifier. Includes the feed query string parameter in the URL. <%# GetBlogCommentUrlForFeed(Eval(“DocumentID”)) %> |
GetDocumentUrlForFeed |
- |
Returns the URL of the transformed document with the feed query string parameter in the URL. The method takes the feed name from the Feed name property of the syndication web part used to generate the feed. Note: Since the method adds the feed query string parameter, please use a different parameter name in the Feed querystring key property of the syndication web part. <%# GetDocumentUrlForFeed() %> |
GetForumPostUrlForFeed |
|
Returns the URL of the forum post specified by the path in the first parameter and the forum identifier in the second parameter. Includes the feed query string parameter in the URL. <%# GetForumPostUrlForFeed(Eval(“PostIDPath”), Eval(“PostForumID”)) %> |
GetMediaFileUrlForFeed |
|
Returns the URL of the media file specified by the GUID in the first parameter and the file name in the second parameter. Includes the feed query string parameter in the URL. <%# GetMediaFileUrlForFeed(Eval(“FileGUID”), Eval(“FileName”)) %> |
GetMessageBoardUrlForFeed |
|
Returns the URL of the message board specified by the identifier of the page containing the message board. Includes the feed query string parameter in the URL. <%# GetMessageBoardUrlForFeed(“DocumentIdObj”) %> |
> Back to the list of transformation method categories
Microsoft SharePoint
See also: Displaying SharePoint data in Kentico
Method |
Parameters |
Description and examples |
GetSharePointFileUrl |
|
Returns the URL of a file from a SharePoint server. The first parameter sets the name of the data column containing the name of the file (FileRef by default). Has optional parameters for specifying file caching and image dimensions. <%# GetSharePointFileUrl(“NameOfColumnContainingPathToFile”, 5, 1024) %> |
GetSharePointImageUrl |
|
Returns the URL of an image file from a SharePoint server. The first parameter sets the name of the data column containing the name of the file (FileRef by default). Has optional parameters for specifying image dimensions. <%# GetSharePointImageUrl(“NameOfColumnContainingPathToFile”, null, null, 300) %> |
> Back to the list of transformation method categories
Placeholders for sublevels in hierarchical data
If you are writing transformations for items from a hierarchical data source (for example page data from the Universal viewer web part), you can add a placeholder that sets the position of sublevels:
For ASCX transformations:
<cms:SubLevelPlaceHolder runat="server" ID="plcSub" />
For Text transformations:
{^SubLevelPlaceHolder^}
When displaying items that have descendants in the hierarchy, the placeholder is replaced by the child level under the given item. If you do not add the sublevel placeholder, the system automatically renders child levels after the code of parent items.
You can use the sublevel placeholder in hierarchical transformations, as well as standard transformations applied to hierarchical data.
Note: The sublevel placeholder only works if the Hierarchical display mode property of the viewer web part is set to Inner.
> Back to the list of transformation method categories
Editing buttons for pages displayed by listing web parts
You can configure listing web parts (such as the Repeater) to display special buttons in editing mode (on the Page tab of the Pages application). The buttons allow users to edit or delete individual items displayed in the list.
To set the exact position of the editing buttons, add the following expression into the code of ASCX item transformations:
##editbuttons##