[kupu-dev] plone / create external link / title attribute
Duncan Booth
duncan.booth at suttoncourtenay.org.uk
Mon Nov 26 22:59:44 CET 2007
Stefan Jurisch <s.jurisch at siegnetz.de> wrote:
> For a customer I have to implement an additional textfield where this
> customer is able to input the content for an optional title attrbute
> while creating an external link. can anyone tell me, how to do that (I
> can implement it myself, I think, but yet I do not even know, where to
> locate the files, in which of them I had to add some code!).
>
Edit 'default/drawers.kupu' the div with id="kupu-drawer" is the HTML for
the external link drawer. The input field kupu-linkdrawer-input is the url.
After editing any .kupu file you must run 'make plonemacros' from the kupu
folder to rebuild the plone wysiwyg macro.
Look in common/kupudrawers.js (search for kupu-linkdrawer-input to find
where it is used). The link itself is created by the call:
this.tool.createLink(url, null, null, this.target, null, 'external-link');
The parameters for createLink are: (url, type, name, target, title,
className)
N.B. In some versions of kupu (all but the latest svn checkout!) the string
'external-link' was passed in the title parameter by mistake.
So all you have to do is add your own field and pass its value as the 5th
parameter to createLink. Also you probably want to initialise the value of
your title field from linkel.title in the createContent method.
More information about the kupu-dev
mailing list