SID-00149: Edit tmplate addition breaks topic parent changing
| Status: |
Answered |
TWiki version: |
4.2.4 |
Perl version: |
indigoperl 5.86 |
| Category: |
CategoryTemplates |
Server OS: |
Windows 2003 |
Last update: |
17 years ago |
Hello,
Since we are now using the
TinyMCE editor, I made a way for users to create links to Wiki pages without having to type the page name (our users were used to the Kupu editor, which has this feature built in).
I wrote a little javascript, and an html form to accomplish this. I looked at the edit template, and saw that the place the access keys are, would be the perfect place to put the Wikilink feature, since none of our users use the access keys.
So, I made a new edit template, edit.test.tmpl (attached).
The new feature works fine. However, one side effect I have noticed is that I cannot change any of the topic parents when using this new template.
I tried changing the names of the html form fields, thinking they were conflicting with others on the page, but no luck.
Does anyone have any advice?
Thanks!
Kathy
--
KathyDeLaCruz - 02 Mar 2009
Discussion and Answer
OK, I figured out my problem -- it was the fact that my new form was being placed inside another existing form, and breaking it.
I ended up making it work by making it like the Access Keys Help pop up window; I made a separate topic containing the link building form & script, and included that in my edit.pattern.tmpl at the top, instead of the
Edit Help twisty, that our users really don't use.
In case someone else is interested, here's what I did in edit.pattern.tmpl:
I added the template definition line:
%TMPL:DEF{"crystal_link"}%%ICON{info}% <a class="twikiPopUp" target="CrystalLinkBuilder" href="%SCRIPTURL{"view"}%/%BASEWEB%/CrystalLinkBuilder">%MAKETEXT{"Build a link to a Wiki page"}%</a>%TMPL:END%
Then I modified the line:
%TMPL:DEF{"toolbar"}%<div class="patternTop">%TWISTYBUTTON{id="edithelp" mode="div" remember="on" link="%MAKETEXT{"Edit help"}%" showimgleft="%ICONURLPATH{toggleopen}%"
hideimgleft="%ICONURLPATH{toggleclose}%"}%</div><!--//patternTop-->%TMPL:END%
to be instead:
%TMPL:DEF{"toolbar"}%<div class="patternTop">%TMPL:P{"crystal_link"}%</div><!--//patternTop-->%TMPL:END%
--
KathyDeLaCruz - 04 Mar 2009
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.