Hi Reinier,

http://wiki.hippo.nl/display/CMS/Overriding+core+CMS+code should be the way to go in this case. But you are probably trying to use the Xinha trunk. Beware that the current Xinha trunk/release has refactored it's core and the current JavaScript API( which is used inside the CMS) probably won't work anymore if you change it to Xinha trunk. The current Xinha is now located in called XinhaCore.js or something similar and the HTMLArea object, which previously existed, does not exist anymore in the new Xinha code and is replaced with the Xinha object.


Hi,

I have a couple of questions about Xinha:

Q1:
I would like to add some plugins to Xinha that don't come standard with the Hippo editor (eg. definition lists). And fiddle with/replace some that are standard (because they don't place themselves correctly on the toolbar).

I was hoping to be able to add the plugins somewhere down my extensions folder and tell Xinha to look there, but haven't found a way to do this.
Any suggestions?

Sure you can create your own Xinha plugins. I've done it in multiple occasions.

Try adding this function to your extended htmlarea.js (which is referenced in the <lib> tag in your BE templates.

HTMLArea.loadExternalPlugin = function(pluginPath, pluginName, callback) {
  // Might already be loaded
  if(eval('typeof ' + pluginName) != 'undefined')
  {
    if(callback)
    {
      callback(pluginName);
    }
    return true;
  }

  var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
          function (str, l1, l2, l3) {
            return l1 + "-" + l2.toLowerCase() + l3;
          }).toLowerCase() + ".js";
  var plugin_file = pluginPath + "/" + pluginName + "/" + plugin;

  if(callback)
  {
    HTMLArea._loadback(plugin_file, function() { callback(pluginName); });
  }
  else
  {
document.write("<script type='text/javascript' src='" + plugin_file + "'></script>");
  }
  return false;
};

Now you should be able to say something like (where Expander is the name of your plugin):

HTMLArea.loadExternalPlugin("/extensions/xinha/plugins", "Expander");



Q2.
Looking through the Xinha docs I don't see any reference to the type of HTML it generates:
XHTML, HTML 4.01, or some older version.
It looks like it is XHTML. If so, is there a way to tell it to generate HTML 4.01?

Xinha itself creates some HTML, which is not always very well formatted. Therefor we have use the HTMLCleaner. In the new version of the CMS, you can choose between XHTML strict and transitional. It will allways generate valid XHTML if you use the HTMLCleaner.


Q3.
I noticed some keyboard shortcuts are defined for Xinha (<ctrl-1> for H1, etc). They have apparently nothing to do with the plugin that allows changes like that from the toolbar.
So is there a way to disable these boys?
(I don't want to allow content editor anything but entering plain text, lists, emphasis etc.)

Yes, you should be able to create your own Xinha plugin for this. You can then catch the key events.


Any help is greatly appreciated.

Thanks,

Reinier van den Born

--

Reinier van den Born

HintTech B.V.
Rotterdamseweg 183c, 2629 HD Delft
T: +31(0)15 268 2573
F: +31(0)15 268 2567
M: +31(0)6 494 171 36
--
HintTech levert specialisten op het gebied van softwareontwikkeling (.NET en Java), projectmanagement, informatiebeveiliging en business consulting.
KvK Den Haag nr. 27242282 | BTW nr. NL8062.16.396.B01
********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html


********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html




********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html

********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html

Reply via email to