ASPX templates
Version 6.x > ASPX templates > How to fix CK Editor to top of screen View modes: 
User avatar
Member
Member
gph - 1/10/2012 9:25:05 PM
   
How to fix CK Editor to top of screen
When editing a document in CMSDesk the CKEditor toolbar is no longer fixed to the top of the editing frame. I know there are settings to put a toolbar on each editable region, but I really miss the original behavior of past versions of Kentico.

I've noticed that editors in custom documents have their toolbar fixed to the top, so it must be possible.

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/10/2012 10:49:33 PM
   
RE:How to fix CK Editor to top of screen
Hello,

Yes, you can set a HtmlAreaToolbarLocation property of an Editable region control to define, where the toolbar will be loaded. In your case it will be HtmlAreaToolbarLocation="In". For more information please follow the link below to our documentation:

http://devnet.kentico.com/docs/controls/index.html?cmseditableregion_configuration.htm

Best regards,
Jan Hermann

User avatar
Member
Member
gph - 1/11/2012 7:34:49 AM
   
RE:How to fix CK Editor to top of screen
What I want is for it to behave like "Out:CKToolbar". However, I don't want the toolbar to scroll with the page. In Kentico 5.x it was fixed.

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/12/2012 2:51:50 AM
   
RE:How to fix CK Editor to top of screen
Hello,

This seems to me like your custom code (or javascript/css) based issue. I was not able to reproduce this issue in some of the pre-defined web sites in version 6.0 (for example Corporate Site). Can you please create simple page with some simple page template which will not inherit anything from root nor use some custom javascripts?

Or

It is also possible, that your pages does not load a cmsedit.js script, which ensures adding an enveloping <div> which fixes the position of a toolbar.

Can you try to use this on your .master page:

<ajaxToolkit:ToolkitScriptManager ID="manScript" runat="server" ScriptMode="Release"
EnableViewState="false" />
<cms:CMSPortalManager ID="manPortal" ShortID="m" runat="server" EnableViewState="false" />

instead of your current code? Please follow this link: http://devnet.kentico.com/docs/devguide/using_the_master_pages.htm for more details.

Best regards,
Jan Hermann

User avatar
Member
Member
gph - 1/12/2012 7:30:27 AM
   
RE:How to fix CK Editor to top of screen
I was using CMSPageManager as in Kentico 5.x. Switching to what you posted above solved my problem. Thanks!

User avatar
Member
Member
batman-execinc - 4/30/2012 6:13:29 PM
   
RE:How to fix CK Editor to top of screen
I also have a 5.x site that I've upgraded to 6.0. Changing to CMSPortalManager fixes the editor toolbar, but breaks all my CMSEditableRegion content - none of it displays.

Is there a different way to fix the editor toolbar?

User avatar
Member
Member
batman-execinc - 5/2/2012 2:18:01 PM
   
RE:How to fix CK Editor to top of screen
On further review, it seems my issue is far more involved. Changing to CMSPortalManager renders the CMSEditableRegions in my Root.Master file broken. They are still editable from the root document of my (.ASPX templated) site, but disappear in every other page, whether viewing in the editor or on the live site.

User avatar
Kentico Support
Kentico Support
kentico_janh - 5/3/2012 1:34:29 AM
   
RE:How to fix CK Editor to top of screen
Hello,

What does it mean "broken"? Could you please post a screenshot of it? What difference is in your case between master page and root document? Could you please describe your problem in more details?

Best regards,
Jan Hermann

User avatar
Member
Member
batman-execinc - 5/3/2012 9:27:14 AM
   
RE:How to fix CK Editor to top of screen
I have 4 master files, the root and three others for three different basic layouts - those three all reference the root.master. When I edit the root document - the "Corporate Site" at the very top of the content tree - I have four editable areas that work normally. This document is the only one that uses the root template that in turn uses the root.master.

In every other document, the master files have content placeholders with CMSEditableRegions in LiveSite view mode, so they're always visible, but only editable from that root document. Since switching to the CMSPortalManager in my root.master, these sections no longer appear anywhere else.

Here's one example where they no longer display at all either on the live site, or when editing any pages using a template that uses this master file. All the CMSEditableRegions are the ones that have disappeared everywhere except when editing that root "Corporate Site" page.

<%@ Master Language="C#" MasterPageFile="~/Aaaai/Layouts/Root.master" AutoEventWireup="true" CodeFile="Home.master.cs" Inherits="Aaaai_Layouts_Home" %>
<%@ MasterType VirtualPath="~/Aaaai/Layouts/Root.master" %>
<asp:Content ID="HeadContent" ContentPlaceHolderID="HeadContentPlaceHolder" Runat="Server">
<link rel="stylesheet" href="~/Aaaai/Styles/Layouts/Home.css" type="text/css" />
</asp:Content>
<asp:Content ID="UtilityNavContent" ContentPlaceHolderID="UtilityNavContentPlaceHolder" runat="server">
<cms:CMSEditableRegion ID="UtilityNav" runat="server" InheritContent="true" ViewMode="LiveSite" />
</asp:Content>
<asp:Content ID="HeaderQuickLinksContent" ContentPlaceHolderID="HeaderQuickLinksContentPlaceHolder" runat="server">
<cms:CMSEditableRegion ID="HeaderQuickLinks" runat="server" InheritContent="true" ViewMode="LiveSite" />
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server">
<asp:ContentPlaceHolder id="MainContentPlaceHolder" runat="server" />
</asp:Content>
<asp:Content ID="FooterMainContent" ContentPlaceHolderID="FooterMainContentPlaceHolder" Runat="Server">
<cms:CMSEditableRegion ID="FooterMain" runat="server" InheritContent="true" ViewMode="LiveSite" />
</asp:Content>
<asp:Content ID="FooterSecondaryContent" ContentPlaceHolderID="FooterSecondaryContentPlaceHolder" Runat="Server">
<cms:CMSEditableRegion ID="FooterSecondary" runat="server" InheritContent="true" ViewMode="LiveSite" />
</asp:Content>

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/3/2012 12:19:35 PM
   
RE:How to fix CK Editor to top of screen
Hi,

I guess you mean that the content inheritance is not working, right? If so, please see this thread. The inheritance worked by mistake in ASPX templates and under special circumstances.

However, you can use this workaround:
<cms:CMSEditableRegion runat="server" ID="txtRegion" RegionTitle="Main text" DialogHeight="150" RegionType="HtmlEditor" InheritContent="true" />
<asp:Label ID="lblRegion" runat="server" Visible="false"/>

protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);

if (CMS.CMSHelper.CMSContext.ViewMode == CMS.PortalEngine.ViewModeEnum.Edit)
{
// If it is some child document (not root)
if (CMSContext.CurrentPageInfo.NodeLevel > 0)
{
PageInfo parentpi = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, aliasPath , CMSContext.CurrentDocumentCulture.CultureCode, urlPath, false, ConnectionHelper.GetConnection());
// Show label for editable region content
this.lblRegion.Visible = true;
// Hide editale region control
this.txtRegion.Visible = false;
this.lblRegion.Text = ValidationHelper.GetString(parentpi.EditableRegions[txtRegion.ID.ToLower()], "");
CMS.ExtendedControls.ControlsHelper.ResolveDynamicControls(this.lblRegion);
}
}


You may need to use also this key in web.config file: <add key=“CMS55Compatibility“ value=“true“ />

Best regards,
Juraj Ondrus

User avatar
Member
Member
batman-execinc - 5/3/2012 4:00:31 PM
   
RE:How to fix CK Editor to top of screen
If I'm understanding this properly, it'll have to be implemented for each of my four global items on each of my three different template master files. This is kind of a long way to go to fix my original problem, which was just making the ckeditor toolbar float when scrolling the edit page.

Is there a separate fix for the toolbar that would allow me to continue to use the CMSPageManager like I had in 5.5 and avoid all this extra work?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/3/2012 7:41:47 PM
   
RE:How to fix CK Editor to top of screen
Hi,

I am sorry but I am not following you right now.

The toolbar position fix is to use the CMSPortalManager (the CMSPageManager will be marked as obsolete and no longer used).

The inheritance issue - regrettably the fact it was working was a bug. The workaround is to use the code above and you will need to use it in all your templates or consider using another approach of displaying the text (e.g. using separate document and repeater will pull the data out of it).

Best regards,
Juraj Ondrus