Quantcast
Channel: Kentico CMS for ASP.NET - DevNet - FAQs - API and Internals
Browsing latest articles
Browse All 36 View Live

How 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 Article



SelectSingleNode 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 Article

How 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 Article

How 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 Article


How 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 Article

How 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 Article

How 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 Article


How 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 Article


How 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 Article

Can 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 Article

How 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 Article

What 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 Article


How 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

How to track all downloads in the analytics module

A bit of customization is required to track all the downloaded files. The problem is that only CMS.File document type downloads are tracked by default. However, you can change that by going to the...

View Article


How to enable custom tree node handlers or document event handlers to be...

By default, document event handlers (6.x) or custom tree node handlers (5.x) are disabled for the staging module. You can enable them by using the following web.config key:   <add...

View Article

Why can I not read a cookie on the client in Kentico CMS 6.0?

The HttpOnly is a flag set on the server side when sending a cookie that instructs the browser to avoid giving client-side scripts access to that data. Prior to Kentico CMS 6.0 the default value of...

View Article


How to maintain scroll position after postback

In case your application runs on .NET version 4.0 the position should be fixed automatically. A combination of .NET 3.5 and browsers like Chrome or Safari causes the position on a page to be lost after...

View Article

When using ASPX templates, how can I change the value of DocType?

As seen in the Developer’s Guide documentation Creating ASPX Master Pages, you can use <%=DocType%> as your doctype declaration in your master pages. The default value is <!DOCTYPE html PUBLIC...

View Article

How can I get cache dependencies for custom tables?

If you need to flush the cache when you edit/add/delete a record in your custom table (the Custom tables module), the cache key is not ‘<custom table class name>|all’, but...

View Article

How do you render properties of a document from the first level of the...

If you want to render properties of a main parent of a document dynamically according to the current path, you can’t use standard path expressions. However there is a simple workaround for that: {%...

View Article


How to create document crawler smart search index using the API?

Our Developer’s guide describes how to create smart search indexes using the API.  With the exception of the Document crawler index type, you can set a value of the newIndex.IndexType property from...

View Article


How to enable classic modal dialogs in Kentico CMS?

In version 7.x of Kentico CMS, modal dialogs are full-screen based and it is not possible to move them as standard modal windows.  A typical example of this default behavior is the web part properties...

View Article

How to render extension-less URLs for documents in navigation web parts

If you setup your site to use extension-less URLs as per our documentation, you may still encounter the problem with navigation web parts (e.g. CMSListMenu) still rendering document links with the...

View Article

How to solve the "Cannot load default column mappings. Default user not...

Navigate to the Site Manager -> Settings -> System section and look for the "Default user ID“ setting, usually this is set to number 53 (global administator).  The corresponding user is used when...

View Article


How to fix "The file XXX is in the special directory App_Themes, which is not...

This problem may occur if your IIS or application is not configured to handle certain extension. Typically, it’s woff, eot and some others. It can be fixed by adding the lines below into your...

View Article

How to get the size of a file in a transformation?

If you want to get a file size of the CMS.File document type, you need to implement a transformation function with one parameter (FileAttachment) and return AttachmentSize property instead:...

View Article

When testing REST in a browser, is there a way to pass more than one...

More parameters can be passed. Standard SQL syntax is used and it must be properly encoded for use within URL (such as %20 for a space).  For example, a country with ID greater than 100 and a name...

View Article

How to change owner/schema of the DB objects?

Please, download and follow these instructions: How to change owner of DB objects.

View Article



Fix "The ConnectionString property has not been initialized“ error, when...

Please make sure your application’s web.config or app config file (depending on your application type) contains connectionString element as per example below: <configuration> ......

View Article
Browsing latest articles
Browse All 36 View Live




Latest Images