Latest in FAQs
You can use sample code below:
// Converts IP4 address to country name.
CMS.WebAnalytics.IP2CountryHelper ip2country = new CMS.WebAnalytics.IP2CountryHelper();
string country = ip2country.GetCountryByIp("<IP>");
Since version 5.5 of Kentico CMS IP2CountryHelper class is static. Therefore, you need to use following code instead:
string country = IP2CountryHelper.GetCountryByIp("<IP>");
You should add the gif file you like to use as an icon of custom document into the directory below:
/App_Themes/Default/Images/CMSDesk/Icons/
Then rename the file according the code name of the document type. Follow the example below how to rename the file:
namespace_documentType.gif
So the name consists of namespace and document type of that document separated by underscore.
UPDATE for v5.5: the location of the icon files was changed to \App_Themes\Default\Images\DocumentTypeIcons\
The system uses the resized versions of media files only if you use the permanent URLs. Please see the settings in:
Site manager -> Settings -> Media libraries -> Site: <your site> -> Use permanent URLs
If the checkbox is unchecked it does not use the resized images from disk. If you check the checkbox it can greatly improve the page performance.
Regrettably, this is a .NET bug. Please see this
forum thread.
You can find the solution there.
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 needs.
-bp-
You can add following key into "/configuration/appSettings" section in web.config file:
<add key="CMSForbiddenURLValues" value="\\/:*?\"<>|&%.'#[]+ =„“" />
it contains all characters forbidden by default so you can just remove characters you want not to be forbidden. E.g. if you want to set "+" character not to be forbidden you can change key to:
<add key="CMSForbiddenURLValues" value="\\/:*?\"<>|&%.'#[] =„“" />
Please take a look to your CSS stylesheet and find following link
CSS class definition:
.CMSTreeMenuTable a
{
white-space: nowrap;
}
It says to the
tree menu not to break the lines. It should work if you remove it or comment it out.
-ov-
If you use BizForm as an inline control, you can adjust its code-behind:
~\CMSModules\Bizforms\InlineControls\BizFormControl.ascx.cs by amending the
SetupControl() method. You will set the BizForm property
UseColonBehindLabel to false like this (be aware of this change in case of future upgrade):
this.Bizform1.UseColonBehindLabel = false;
On the other hand, in case you use it as a webpart, there is an easy solution for that. Please locate to webpart properties (on the Design tab) where you can see the
'Use colon (:) in labels' property. You need to set it to false.
-ov-
Please follow procedure bellow:
1. Add the asp:panel control into page and asp:literal control into this panel
2. Set the text with inline control macro into literal's 'Text' property
3. Call: ControlsHelper.ResolveDynamicControls(idOfPanel) to resolve the inline macros.
-md-
There are two possible reasons of this issue. First one is browser based and it is described in
this FAQ.
Second one could be caused by the fact, that the
‘Selected item transformation’ property of the Lightbox webpart is not set. In this case, there needs to be the image tag rendered when seeing selected items. For instance you can use our predefined
‘CMS.File.LightboxSelected’ transformation which contains code as follows:
<img src="<%# GetFileUrl("FileAttachment") %>" title="<%# Eval("FileName") %>" alt="" />
This transformation is intended for
CMS.File document type based documents, so if you store files any other way, you will need to adjust it as per your needs.
Links to other resources:
Writing transformations
Lightbox properties
-ov-
The Header section of page template is not inherited from parent document's page template, if the document type used for this document is not set to "Behave as Page (menu item)".
You need to set the property to true:
Site manager -> Development -> Document types -> edit document type -> General -> Behaves as Page (menu item) type
-hg-
We’ll see an example of
Submit button element of the
Logon form webpart. You can add your custom CSS class to the Logon input button following way:
1) Please open Logon form webpart properties. At the top of opened window there two tabs, right one is
Layout. Please switch to this one.
2) You will need to create new layout, in order to be able to edit it.
3) Once you use your custom layout you can add CssClass property to the button control, so that it can finally look like this:
<cms:LocalizedButton CssClass="LogonButton" ID="LoginButton" runat="server" CommandName="Login" ValidationGroup="Login1" EnableViewState="false" />
This will enforce adding CSS class to the input element which represents your button. Basically, you can change/add the CSS classes of other inputs (textboxes) the same way. Please note, this procedure is applicable also for other similar form webparts like Change password, Sign out button, etc.
-ov-
Regrettably, neither styles from stylesheet specified in 'Site CSS stylesheet' nor 'Editor CSS stylesheet' are applied in toolbar of WYSIWYG editor. You will need to put styles also into ~\CMSAdminControls\FCKeditor\editor\css\fck_toolbarcombopreview.css file. You may need to clear browser's cache for these changes to take effect.
Basically, you can follow the
Print page article from Dev.Guide. Regrettably, there is no method that returns whole content of page, but you can get content from all editable regions by calling GetEditableValue method manually for every editable region on the page:
<%# GetEditableValue("IdOfEditableRegion") %>
-md-
This functionality is not supported when shared toolbar is used. You may change the 'HTML editor toolbar location' property of particular editable region (in 'configure' dialog) to 'In-line toolbar'. Please note that the FitWindow will fit the region into current frame, i.e. the section under 'Save' and 'Spellcheck' buttons where the page mode is displayed, not the whole page.
The possible reason could be Google analytics JavaScripts. If you use them please try to remove them and test the behavior. Regrettably, they do not work well together with our multilingual system.
Another reason could be that one culture uses the same custom URL (Properties -> URLs) as document Alias path. Please check the custom URLs of all cultures, all of them should use different strings. Alternatively, you may use empty string (Use custom URLs is checked) for all cultures. Then the system will handle cultures correctly.
-hg-
It may happen that document name (especially for certain document types) can contain different information from the expected value set on Form tab. This is probably caused by setting incorrect field which is used for document name within particular document type. One can choose it during document type creating or for preexisting document type by accident anytime else.
You can change it in:
Site Manager -> Development -> Document types -> particular_document_type -> Fields. Here is dropdown list called
‘Document name source field’ where you can choose whatever field from actual document type as per your needs. Finally you need to save document itself to change its name to correct one.
Defining a new document type documentation.
-ov-
Could you please add following code into 'Search condition' property of SmartSearchResults web part:
-NodeLinkedNodeID:[0 TO 999999999]
-md-
Actually this is known issue in version 5.0, where there is a support for resumable download. Regrettably in combination with Adobe PDFs (which has unexpected specification of bytes) it crashes. Fortunately within the
hotfix 5.0.11 (well, you could rather apply the latest one), there is implemented workaround for this issue, so please try it.
It will be also necessary to add following key to your web.config file:
<add key="CMSGetFileAcceptRanges" value="false" />
-ov-
This issue may be caused by using some plug-in in the Visual Studio. You can try running the Visual Studio with
/SafeMode parameter to see if any of installed plug-ins causes the problem. You can also open the project as an existing web site. More details about running the Visual Studio in the Safe Mode can be found on
Microsoft web site.