FAQs >
Content management
If you want to configure the page title, you have a choice of the following methods:
A: Go to the CMS Desk and select the document in the content tree. Now open
Properties -> Metadata and set the document page title in the
Page title field.
B: The page title format will be generated according to the configuration in
Site Manager – Settings - <your site> - Content - Page title format. If, for example, you would like to check if the document has a unique page title and, if so, to display only this title, you can use the following macro:
{%(documentpagetitle=="")?prefix +"-"+pagetitle_orelse_name:documentpagetitle%}
This will display a default value if the
Page title in the Metadata section is empty. Otherwise it displays the page title from the Metadada section.
-it-
You need configure the "Order by" property in your web part (e.g. in repeater) like following:
NodeLevel, NodeOrder, NodeName
If you want to add a new font into the drop-down list of fonts in the CK Editor, you need to add the definition of that font into the ckeditor.js file, which is located in the ~\CMSAdminControls\CKeditor\ directory. However, the content of the file is minimized so it is difficult to navigate there. The code where you can make changes to fonts is on line 57 and it looks like this:
i.font_names='New font/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif';
where the format of font definition is:
Title/Font style definition;
-jh-
When viewing your Form from CMS Desk -> Tools -> Forms, after you click edit on your form, you should see the data tab. You can find the option to export the form data by clicking Actions on the table header. This should bring up a pop-up with the export options listed.
-ag-
In order to display attachments in a transformation from the Document attachments field of a document, you can take advantage of the Text/XML transformation type and the following macro:
{ % foreach (attachment in Documents[NodeALiasPath].AllAttachments) {
"<a href='~/getattachment/" attachment.AttachmentGUID "/attachment.aspx'>" attachment.AttachmentName "</a><hr />";
} # % }
-jh-
Please note that this behavior is proper and by design. Web parts and their setting are binded to the page template and are shared on all pages, using the same template. This behavior concerns web parts itselves, and its properties (in general everything what you can see/change on Design tab). It is not concern to Page mode, so for example content of some web parts (editableText, editableImage, ...) is page independent and can be different even on shared page template. You can solve it if you create ad-hoc template (Properties -> Template). Then you will get independent, but the same templates, and you can change iis content for particular page, with no influence to other pages. For more details please see this
knowledge base article.
Want to modify the default CK Editor, but not sure which attributes can be set? You can find a full list of CKEDITOR configuration settings here:
docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
These changes can be applied to the ~\CMSAdminControls\CKeditor\config.js file, after which you will need to restart the application, clear the application cache, and clear the browser cache depending on which browser you are using. You can restart the application and clear the application cache from Site Manager -> Administration -> System.
You can switch to source mode of WYSIWYG editor using CTRL + TAB keys combination. (This might be useful for example when you want to change html source of ProductDescription field on Product tab of your Product in CMS Desk where source button of WYSIWYG editor is not available by default.)
The 'FitWindow' 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 whole page.
To set a different default order for your custom tables you need to modify a system file, so please do it carefully and make a backup first.
Let's say you have a
title field in your custom table according to which you want to order your items by default. You would first open the
\CMSModules\CustomTables\Controls\CustomTableDataList.ascx.cs file and find the
HasItemOrderField method. Create a new similar method but for your custom field:
public bool HasTitleField
{
get
{
if (FormInfo != null)
{
return (FormInfo.GetFormField("title") != null);
}
else
{
// If form info is not available assume ItemOrder is not present to prevent further exceptions
return false;
}
}
}
Then, scroll down to where the
Page_Load method ends and update the code to be similar as follows:
if (HasTitleField)
{
gridData.OrderBy = "title DESC";
}
else if (HasItemOrderField)
{
gridData.OrderBy = "ItemOrder ASC";
}
-jh-
You can add emoticons to the CKEditor by editing the file
~\CMSAdminControls\CKeditor\config.js (Kentico CMS 6.x), and adding the value 'Smiley' to the toolbar you wish to display the emoticons. Please see the example below:
config.toolbar_Full = config.toolbar_Default =
[
['Source', '-'],
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', 'SpellChecker', 'Scayt', '-'],
['Undo', 'Redo', 'Find', 'Replace', 'RemoveFormat', '-'],
['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-'],
['NumberedList', 'BulletedList', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-'],
['InsertLink', 'Unlink', 'Anchor', '-'],
['InsertImageOrMedia', 'QuicklyInsertImage', 'Table', 'HorizontalRule', 'SpecialChar', 'Smiley', '-'],
['InsertForms', 'InsertInlineControls', 'InsertPolls', 'InsertRating', 'InsertYouTubeVideo', 'InsertWidget'],
'/',
['Styles', 'Format', 'Font', 'FontSize'],
['TextColor', 'BGColor', '-'],
['Maximize', 'ShowBlocks']
];
-eh-
For some files, the default behavior in IIS is to set the content-disposition to “attachment”. You can do this by adding a rewrite rule to your web.config. The following should work:
<rewrite>
<outboundRules>
<rule name="remove cd">
<match serverVariable="RESPONSE_Content-Disposition" pattern="attachment; filename=.+txt$" />
<action type="Rewrite" />
</rule>
</outboundRules>
</rewrite>
This removes the content-disposition header for txt files and should cause the file to be loaded inline, assuming the client’s browser is not overriding the default behavior for the mime type.
Note: You may need to install the
URL rewrite module to your IIS.
-ag-
Edit the file ~\CMSAdminControls\CKeditor\config.js and add the following code: config.scayt_autoStartup = true; directly above the config.toolbar code for the toolbar you are using. Please see the example below:
config.scayt_autoStartup = true;
config.toolbar_Full = config.toolbar_Default =
[
['Source', '-'],
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', 'SpellChecker', 'Scayt', '-'],
['Undo', 'Redo', 'Find', 'Replace', 'RemoveFormat', '-'],
['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-'],
['NumberedList', 'BulletedList', 'Outdent', 'Indent', 'Blockquote', 'CreateDiv', '-'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-'],
['InsertLink', 'Unlink', 'Anchor', '-'],
['InsertImageOrMedia', 'QuicklyInsertImage', 'Table', 'HorizontalRule', 'SpecialChar', '-'],
['InsertForms', 'InsertInlineControls', 'InsertPolls', 'InsertRating', 'InsertYouTubeVideo', 'InsertWidget'],
'/',
['Styles', 'Format', 'Font', 'FontSize'],
['TextColor', 'BGColor', '-'],
['Maximize', 'ShowBlocks']
];
-eh-
If you want to display the content you have entered in the
Default text property of your
Editable text web part to an editor’s field to make it editable on a Page tab, please open the
~\CMSWebParts\Text\editabletext.ascx.cs file and update the code as it is shown below. The code is located around the line 711 in the
LoadContent() method:
…
case CMSEditableRegionTypeEnum.HtmlEditor:
// HTML editor
if ((forceReload || (!RequestHelper.IsPostBack()) || (viewMode != ViewModeEnum.Edit)) && (this.htmlValue != null))
{
if (content == "") this.htmlValue.ResolvedValue = DefaultText;
else this.htmlValue.ResolvedValue = content;
}
break;
…
-jh-
K# syntax allows you to apply transformations in macros. See here:
Transformations macro expressions for more details.
However, the
ApplyTransformation method does not work with all kinds of transformations.
Text/XML and
HTML type of transformations are supported. Others, regrettably, are not.
-hg-
To open the dialog window of your media gallery and have it display only regularly-used files, you can click on the small black arrow to collapse the properties frame.
At present, there is no property or setting for having this collapsed by default and you would therefore have to manually request it each time you open it, however you can simulate that extra click by using the following javascript:
$j(document).ready(function () {
$j('.DialogResizerArrowV').click();
});
To make it work in media galleries, please place it into the
~\CMSModules\MediaLibrary\Controls\MediaLibrary\MediaLibrary.ascx file.
-jh-
You will need to edit the ~\CMSPages\GetFile.aspx file and add your Google analytics code to this file. You should receive JavaScript code with your account number from Google. Place this code into the GetFile.aspx file under the first line of code. Please see the example below:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetFile.aspx.cs" Inherits="CMSPages_GetFile" %>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<YOUR ACCOUNT HERE>']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
When you create a document based on your custom document type in CMSdesk -> Content (or other type than Page (menu) item), it inherits the page template from the parent document automatically. However, you may want to choose the page template manually.
To achieve this, you will need to define a special "new page" step. It can be the same as for the Page Menu Item document type. So please go to Site Manager -> Development -> Document types -> Edit -> General tab and define a New page property like this: ~/cmsdesk/Content/newpage.aspx.
Even if you have enabled the YouTube video button in the forum WYSIWYG editor, the video is not shown in the forum post when a user fills all the necessary data for the Youtube video in the dialog and clicks OK.
The trick lies in the following setting which needs to be set on (either for the whole forum group or on a particular forum level):
Enable images in posts: Advanced dialog
You can find it in the
CMS Desk -> Tools -> Forums -> Edit -> General tab.
-ov-
We will demonstrate a behavior on the Paste button inside an editable text area.
If you right click on it, the Paste option is visible and Paste dialog is opened. You may need to change this default behavior and open dialog Paste as a plain text instead.
In this case can insert following line into the file:
~/CMSAdminControls/FCKeditor/editor/plugins/Shortcuts/fckplugin.js (or another registered script)
FCKCommands.LoadedCommands['Paste'] = new FCKPastePlainTextCommand();
Links to other resources:
Custom FCK editor toolbar
-it-
For disabling of the spell check option please set the "
ShowSpellCheck" property of the editmenu in the file
~\CMSModules\Content\CMSDesk\Edit\EditMenu.aspx to "
false". This disables the button in CMSDesk. If you want to hide this button on a User Contribution, you should be able to apply the same approach on the file
~\CMSModules\Content\Controls\UserContributions\EditForm.ascx.
-bp-
You can achieve your goal by following procedure below.
1) Open <your project>\CMSAdminControls\UserContributions\ContributionList.xml file
2) comment out this:
<column source="DocumentWorkflowStepID" externalsourcename="DocumentWorkflowStepID" caption="$Contribution.Columns.WorkflowStep$" wrap="false">
</column>
3) Save the file.
You can create
custom scheduled task that checks documents and if there is some document with
Publish To older than current date, the task moves it to
Archive step. We have some sample code in our Developer’s guide -
Archive the document.
Open the file ~\CMSDesk\Content\ContentTree.ascx.cs and alter the following line (in the 4.0 version it can be found around line 230 within the object public TreeSiteMapProvider MapProvider):
mMapProvider.OrderBy = "NodeOrder ASC, NodeName ASC, NodeAlias ASC";
If you want to invert the order of nodes the mentioned line should look the following way:
mMapProvider.OrderBy = "NodeOrder DESC, NodeName DESC, NodeAlias DESC";
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\
"When I try to add a new node to the content tree by right clicking on the node and using the context menu, some icons images are not found. Although when I use the New button on the ribbon bar the problem seems not to happen."
This issue is actually connected to the format of document type icon images. You need to re-sample them to .png images. This way, the icons from the following location will be shown correctly:
~\App_Themes\Default\Images\DocumentTypeIcons\<namespace>_<documentType>.png
Please see the following article:
Defining a new document type for some additional information.
-ov-
Generally speaking, the ScriptResource files (the .axd files) are not loaded properly (404 error).
There are 2 possible causes of this issue (as far as we’re concerned):
1) It may be that your IIS server can't handle them - the .axd files are not allowed. Please configure the handler mappings as described here:
http://technet.microsoft.com/en-us/library/cc771240%28WS.10%29.aspx
Another possible cause, when speaking about the IIS settings, can be the "
Invoke handler only if request is mapped to file" option (it is called "Verify that file exists" in IIS6) - this needs to be
unchecked. It is further discussed here:
http://forums.iis.net/t/1092696.aspx
In case you use a shared hosting environment, please contact your hosting provider to check, whether they have enabled the .axd files support on their server. Ask them whether there any restrictions for those script resources files.
2) It is also possible that you are missing the ScriptResource registration within handlers section of your web.config file (
http://blogs.telerik.com/atanaskorchev/posts/08-07-18/web_resources_demystified_part_3_troubleshooting.aspx). Please add the following line (in bold) to the system.webServer section:
<system.webServer>
...
<handlers>
...
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
...
</handlers>
</system.webServer>
If you are missing the enwrapping handlers section, so please add it as well. The above registration applies to .NET 3.5. Should you use .NET 2.0 version, please use the following one:
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
Afterwards, please restart your application and it should work as expected.
-ov-
The WYSIWYG editor automatically encodes Greek characters to entities in the "text" mode. They can be stored in pure, non-encoded format only in the "Source" mode of the editor.
You can change this by turning this encoding off in the editor configuration:
Please find the
~\CMSAdminControls\FCKeditor\fckconfig.js file
and approx. in the line 79, please change the following property value from "true" to "false":
FCKConfig.IncludeGreekEntities = false;
Please note that you may need to clear the cache (temporary files) of the browser to apply the changes.
-zc-
By default Bad words module filters even parts of words, e.g. it filters 'classic' to cl***ic'. If you want to ensure only entire words are considered you can use following sample regular expression for particular bad word (you need to check 'Bad word is a regular expression' checkbox for this word): \bword\b
e.g.: \bass\b
You need to set IsLiveSite property of CMSHtmlEditor control to 'true':
<cms:CMSHtmlEditor ID="htmlTemplateBody" IsLiveSite="true" runat="server" ToolbarSet="Default">
</cms:CMSHtmlEditor>
Without this setting 'QuicklyInsertImage' button is displayed only if you are logged in.
New feature of Kentico CMS 4.1 called progress indicator, which is used for example when saving documents in CMS Desk interface to keep user notified about the fact that changes are being saved, might not be suitable for all of the users. You can simply disable this feature by adding following key in web.config file:
<add key="CMSAllowProgressScript" value="false" />
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.
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-
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-
Please note that IE8 was not supported in 3.x versions. You may upgrade to the latest
FCKEditor 2.6.5 (in
/CMSAdminControls/FCKEditor/) and then just commented out lines 141, 142
// if ( typeof window.DoResizeFixes == 'function' )
// window.DoResizeFixes() ;
You can change default page template in Site Manager -> Development -> Document types -> edit appropriate document type (e.g. Event) -> Default page template (select).
The more concrete workflow is stronger. For example: the workflow with “/news” scope is stronger than the workflow with “/” scope inside the /news section. It there are two workflows with the same scope specified, one of the workflow is selected in non deterministic way.
It might be possible that there is additional <form> html tag in your page template which is causing such behavior. Since it is not possible to use nested form tags in Kentico CMS, please remove such additional <form> tag.
For this purpose, you can use existing pre-defined FAQ document type (CMS.Faq), create document of this document type in CMSDesk -> Content (you will maybe need to allow CMS.Faq document type as a child type of CMS.MenuItem. This can be done in Site Manager -> Development -> Document types -> edit cms.menuitem -> Child types tab) and use repeater web part to display appropriate content.
You can also use pre-defined page templates in FAQ section. In this case, you need to create page of type CMS.MenuItem with FAQ page template. Then, this page is using CMSRepeater web part which is already pre-configured. You would need to add FAQ page under your current node of type CMS.Faq and the Repeater should display your FAQ question/answer.
Kentico CMS 4.0 uses protected e-mail links by default. If you do not like this behavior for some reason, you can simply modify ~\CMSAdminControls\FCKeditor\fckconfig.js file and delete following two lines:
FCKConfig.EMailProtection = 'encode' ; // none | encode | function
FCKConfig.EMailProtectionFunction = 'mt(NAME,DOMAIN,SUBJECT,BODY)' ;
This would also require clearing browser's cache.
If any of your documents would have file uploader control with image attachment, you can edit this image file in Form tab in CMS Desk of particular document using green pencil image next to your image attachment.
You could apply the patch of FCKEditor. Please see here:
dev.fckeditor.net/ticket/2272 for more information.