Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-02-11 06:53:39

joshna
New member
Registered: 2007-02-06
Posts: 8

Help needed to embed xinha in a portlet

Hi

I am trying to embed xinha editor in a portlet.But xinha is not being loaded.I could see only the textbox.No editor buttons are being displayed.

Below is the code in my view.jsp .The same code is working for a webapplication.

Can anyone suggest  me the changes  that need to be done to embed in a portlet.

Expecting a quick reply as I need this for my project .



<!DOCTYPE BHTML PUBLIC "-//BC//DTD BHTML 3.2 Final//EN">
<html>
    <head>   <script>
         _editor_url  = "/xinha/";
         _editor_lang = "en";
         _editor_skin = "blue-metallic";
        </script>
        <script type="text/javascript" src="/xinha/XinhaCore.js"></script>
       
       
        <script type="text/javascript">
  xinha_editors = null;
    xinha_init    = null;
    xinha_config  = null;
    xinha_plugins = null;
   
      xinha_init = xinha_init ? xinha_init : function()
    {
    xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
    if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;
  xinha_editors = xinha_editors ? xinha_editors :
      [
        'newbiearea1'
      ];

     
       xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
       
             xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);
Xinha.startEditors(xinha_editors);
    }

    window.onload = xinha_init;
        </script>
    </head>
   
    <textarea id="newbiearea1" name="newbiearea1" rows="10" cols="50" style="width: 100%"></textarea>
</html>

Thanks in advance.
joshna.

Offline

#2 2007-02-11 10:14:29

jedi58
Xinha Authority
From: Leicester, UK
Registered: 2007-01-14
Posts: 113
Website

Re: Help needed to embed xinha in a portlet

no body tags?


David G. Paul
[url]http://www.newearthonline.co.uk[/url]

Offline

#3 2007-02-15 00:51:14

Practicality
Xinha Community Member
Registered: 2007-02-15
Posts: 24

Re: Help needed to embed xinha in a portlet

You might wnat to specify the type in your first script tag as well:

<script type="text/javascript">
instead of just <script>

It usually does not make a difference, but in some browsers that can be important.

A body tag would be good.

Also, your list of plugins is blank. Many (most) of the buttons come from plugins.

Instead of:     xinha_plugins = xinha_plugins ? xinha_plugins : [ ];
This is what I use (go for something simliar, depnding on what you need):

      xinha_plugins = xinha_plugins ? xinha_plugins :
      [
       'CharacterMap',
       'EditTag',
       'ContextMenu',
       'FullScreen',
       'ListType',
       'SpellChecker',
       'Stylist',
       'SuperClean'
      ];

Also, while I think it might revert to the default when you don't specify, you might want to try specifying what buttons you want. Such as:

       xinha_config.toolbar =
         [
           ["popupeditor"],
           ["separator","formatblock","bold","italic"],
           ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
           ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
           ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
           ["linebreak","separator","undo","redo","selectall","print"], ["cut","copy","paste"],
           ["separator","killword","clearfonts","removeformat"],
           ["separator","htmlmode","showhelp","about"]
         ];

Of those several things, one of them is probably the one for which you are looking.

Offline

#4 2007-02-23 10:20:30

hdk
New member
Registered: 2007-02-23
Posts: 1

Re: Help needed to embed xinha in a portlet

I'm trying to make a minimal xinha editor, but it's not working.
All the users should be able to do is add a link to some text.

I've tried setting xinha_config.toolbar to this, but I still get the default editor with all buttons.

       xinha_config.toolbar =
         [
                  ["popupeditor","createlink"]
         ];

To rule out any trouble with my configuration, I tried this in the example file found in this post:
http://xinha.gogo.co.nz/punbb/viewtopic … 1194#p1194

No luck. Setting  xinha_config.toolbar doesn't appear to change anything.

Ideally, I want only some editors to be minimal. According to the documentation, I should add something like this in Step 4 of my configuration file.

       xinha_editors.newbiearea1.config.width  = 200;
       xinha_config.newbiearea1.toolbar =
         [
                  ["popupeditor","createlink"]
         ];

Any idea in what is going wrong?

Offline

#5 2007-02-23 12:47:05

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Help needed to embed xinha in a portlet

maybe having a look at this example helps? http://xinha.raimundmeyer.de/x_examples/restricted.php

Offline

Board footer

Powered by FluxBB