Security settings for document are not handled by CustomTreeNodeHandler
This is caused by this setting doesn't affect directly the data of document. You can use OnAfterInsert method of CustomDataHandler instead (there comes SimpleDataClass object in dataObj parameter and...
View ArticleDataObj parameter in CustomHandler seems to be of type SimpleDataClass not...
The 'dataObj' object can be both of DataClass and SimpleDataClass class in according to circumstances. Could you please check the class first and then re-type the object to appropriate class? Please...
View ArticleHow to query custom table using API
You can also use following sample code to get data (DataSet) from custom table: CMS.SiteProvider.CustomTableItemProvider tp = new...
View ArticleHow to disable URL extension on page postback
If you are using extension-less ULRs for your web site, by default any postback adds an .aspxextension to the URL. You can disable this behavior using following key in your web.config file: <add...
View ArticleHow to sort documents selected by SelectNodes API method
You may use the overloaded method with OrderBy parameter (see API Reference for more details) but it sorts documents only within one document type. If you use more document types (classes) please use...
View ArticleHow to get last comment from version history in custom workflow handler
You can use sample code bellow: CMS.TreeEngine.TreeNode node = treeNodeObj as CMS.TreeEngine.TreeNode; int documentCheckedOutVersionHistoryID = node.DocumentCheckedOutVersionHistoryID;...
View ArticleHow to get data of file attached to document
You can use sample code bellow: using CMS.SiteProvider; ... // Tree node CMS.TreeEngine.TreeNode node = null; // Tree provider UserInfo ui = UserInfoProvider.GetUserInfo("administrator");...
View ArticleSelectSingleNode method doesn't work in version 5.0
Please check if you use '%' character in your path for representation of sub-tree. If so, please remove it and specify full alias path of document instead. This macro is no longer supported by this...
View Article"'CMS.GlobalHelper.ImageHelper' does not contain a definition for...
This issue may occur after upgrade to version 5.0. There should be following code in version 5.0 in ~\CMSInlineControls\ImageControl.ascx.cs (round the line 480): imgParams.Url =...
View ArticleHow can I resolve a localized string on the ASPX template?
You can encounter a problem that <%# ResHelper.GetString(key) %> does not work. Please use this format: <%= ResHelper.GetString(key) %> -hg-
View ArticleHow do I change the context menu for managing friends?
The context menu is generated by the UserContextMenu control located in ~\CMSAdminControls\ContextMenus\UserContextMenu.ascx.cs. To change the context menu edit the mentioned file according to your...
View ArticleHow can I use the IF clause within the transformation?
If you want to check for example NewsTitle field if it contains the word: “Home” you can use the if condition like this: <%# (Eval("NewsTitle").ToString().Contains("Home")) ? "go home" : "go away"...
View ArticleHow can I set up the full page cache to reflect the domain name?
You can set up the global property: CMS.CMSOutputFilter.OutputFilter.CacheItems The current value is "username;sitename;lang;browser" but you can add the domain there like:...
View ArticleHow can I get data of original document when I copy the document content to a...
If you copy the document content from another language in CMSDesk, you can get data of original document in the OnAfterInsertNewCultureVersion method of CustomTreeNodeHandler like: string...
View ArticleHow to resolve the inline controls programmatically
If you want to resolve the Inline controls for example on an ASPX template or in your custom web part, you can use the CMS.ExtendedControls.ControlsHelper.ResolveDynamicControls(Control parent)...
View ArticleHow to set up a web part to be visible on two pages
If you want to configure a web part to be visible on one page (e.g. Home), you can use a simple macro in the Visible web part property: {%DocumentName|(equals)Home|(truevalue)true|(falsevalue)false%}...
View ArticleCan I use nested macros for the (equals) or (not equals) macro parameter?
Regrettably, the nested macros are resolved too late for the condition. That is why the nested macros work for the branches of condition - (truevalue) and (falsevalue) parameters but not for the...
View ArticleHow to resolve text with Localization macros according to a specific culture
You can use a code like: string output = ResHelper.RegExLocalize.Replace(input, LocalizedStringMatch); where input is a string with localization macros. Then you need to specify LocalizedStringMatch,...
View ArticleWhat hotfix am I currently using?
In newer versions (5.5 and higher) you can simply use the query below to get the hotfix number from the database: SELECT KeyValue, KeyName FROM CMS_SettingsKey WHERE KeyName = 'CMSHotfixVersion'...
View ArticleHow to let the user access a module in CMS Desk which is available only in...
The easiest way is to create a new link to the pages in CMS Desk by defining a new UI element. In this example we will use the UI Cultures module as an example. At first, navigate to...
View Article