Settings for all Portals

Jan 14, 2012 at 7:40 AM

Hi,

I'm planning on using the CKEditor on an installation with 150 portals.
I searched but did not find a way to set the editor settings for the installation (for all portals)

Is there a way to do that?

Or even better, change the default that get's loaded, until the settings are edited in a portal?

Thanks, Timo

Coordinator
Jan 14, 2012 at 2:31 PM

Just Released a new BETA Version

There are now 2 xml files which will be placed in the folder "..\Portals\_default"

"CKToolbar.xml" - File contains the Toolbar Sets

"CKEditorDefaultSettings.xml" -  File contains all default Settings (You can also use the same file on the Editor Options Page for Import or Export). These Settings will be only used when no Portal/Page/Module Settings can be found.

Both Files will be used as Base, and copied to the actuall Portal Home Directory "..\Portals\PORTALID"

Hopefully that solution makes sense and works for you.

Jan 14, 2012 at 6:04 PM

Right, that makes perfect sense, that's the best location for it IMO.
It allows us to prepare a default xml file.
Great feature!

I get this error on a test site were i upgraded from the .20 to the .21 version though:
(On DNN 5.6.3)

An error has occurred.
DotNetNuke.Services.Exceptions.ModuleLoadException: There is an error in XML document (2, 2). ---> System.InvalidOperationException: There is an error in XML document (2, 2). ---> System.InvalidOperationException: <ArrayOfToolbar xmlns=''> was not expected. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderSettingBase.Read6_SettingBase() --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) at WatchersNET.CKEditor.Utilities.SettingsUtil.GetDefaultSettings(String homeDirPath) at WatchersNET.CKEditor.Web.CKEditorControl.LoadAllSettings() at WatchersNET.CKEditor.Web.CKEditorControl.CKEditorInit(Object sender, EventArgs e) at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at DotNetNuke.UI.UserControls.TextEditor.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---


Two more questions:

1. Could the config files be stored in a subfolder too (in the portal folder)?
I have had admins already ask what the xml file in the root was for and ask if they can delete it.
"_CKEditorConfig" would be a great name for instance, it would normally also not show up for admins...

2. I'm guessing you mean \Portals\PORTALFOLDER and not \Portals\PORTALID, right?
(I always use a custom folder for clients, to make it easier to find their portal folder)

Thank for the quick reply!

Timo

Coordinator
Jan 14, 2012 at 7:58 PM

Issue is fixed

 

1. That would require to store the folder location somewhere. I could store that location in the web.config in the editor provider string. But that would make it the default folder for all portals. You can test this by adding the ck_configFolder="_CKEditorConfig" setting to

<add name="CKHtmlEditorProvider" type="WatchersNET.CKEditor.CKHtmlEditorProvider, WatchersNET.CKEditor" providerPath="~/Providers/HtmlEditorProviders/CKEditor/" ck_skin="black" ck_toolbar="Full" ck_browser="standard" />

Editor Provider String. I updated the Beta Downloads

2. Yes i mean that folder called HomeDirectory in DNN

Jan 16, 2012 at 7:24 PM

Ok, I re-installed the .21 beta, but I still get the error...

An error has occurred.
DotNetNuke.Services.Exceptions.ModuleLoadException: There is an error in XML document (2, 2). ---> System.InvalidOperationException: There is an error in XML document (2, 2). ---> System.InvalidOperationException: <ArrayOfToolbar xmlns=''> was not expected. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderSettingBase.Read6_SettingBase() --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) at WatchersNET.CKEditor.Utilities.SettingsUtil.GetDefaultSettings(String homeDirPath, String alternateSubFolder) at WatchersNET.CKEditor.Web.CKEditorControl.LoadAllSettings() at WatchersNET.CKEditor.Web.CKEditorControl.CKEditorInit(Object sender, EventArgs e) at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at DotNetNuke.UI.UserControls.TextEditor.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---

Jan 16, 2012 at 7:25 PM

BTW, setting the base config folder in web.config would be good idea.

Coordinator
Jan 17, 2012 at 9:35 AM
timo_design wrote:

Ok, I re-installed the .21 beta, but I still get the error...

An error has occurred.
DotNetNuke.Services.Exceptions.ModuleLoadException: There is an error in XML document (2, 2). ---> System.InvalidOperationException: There is an error in XML document (2, 2). ---> System.InvalidOperationException: <ArrayOfToolbar xmlns=''> was not expected. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderSettingBase.Read6_SettingBase() --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) at WatchersNET.CKEditor.Utilities.SettingsUtil.GetDefaultSettings(String homeDirPath, String alternateSubFolder) at WatchersNET.CKEditor.Web.CKEditorControl.LoadAllSettings() at WatchersNET.CKEditor.Web.CKEditorControl.CKEditorInit(Object sender, EventArgs e) at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at DotNetNuke.UI.UserControls.TextEditor.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---

Looks like the files are not correctly replaced on the reinstall. Simply extract the CKEditorDefaultSettings.xml from the install Package and extract it to the /Portals/_default/ Folder and delete the ones in your  \Portals\PORTALFOLDER folder

Jan 17, 2012 at 11:35 AM

You're right, should have thought of that myself :-)

The new web.config ck_configFolder="_CKEditorConfig" works great!.

Thanks a lot!

Timo