using nicEdit on mywiki

6 views
Skip to first unread message

murray3

unread,
Feb 15, 2009, 8:18:30 AM2/15/09
to web2py Web Framework
I have been trying out variations of the mywiki app which forms
part of the tutorial in web2py book, using the latest web2py.

I thought I would try incorporating nicedit into the editing view.

Using standard nicedit config in the view does not allow for the
nicedit icons to show? I have looked at obvious (to me anyway:)
issues by viewing nicedit forums etc, and by trial and iteration
of removing my styles and web2py styles to see if this fixes
problem.

It appears to be a problem with nicedit path to the nicEditIcons.gif
but I have tried and failed to solve it. Here is code for my edit
page which is same as original mywiki code with addition of nicedit.

{{extend 'layout.html'}}
<script src="{{=URL(r=request,c='static',f='nicEdit.js')}}" type="text/
javascript"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<h1>Edit wiki page</h1>
[ {{=A('show',_href=URL(r=request,f='show',args=request.args))}} ]<br/
>
{{=form}}

nicedit.js is in static folder and nicEditIcon.gif is in same folder,
edit.html is in
views/default/edit.html

as usual help most appreciated, maybe I'm sleeping and missed obvious
error!
regards
chrism

mdipierro

unread,
Feb 15, 2009, 3:35:08 PM2/15/09
to web2py Web Framework
<script><!--
$(document).ready(function()
{
new nicEditor({fullPanel : true, iconsPath '{{=URL
(r=request,c='static',f='nicEditorIcons.gif')}}'}).panelInstance
('body');
});
//--></script>

murray3

unread,
Feb 15, 2009, 5:16:11 PM2/15/09
to web2py Web Framework
Massimo,
does not work at all using this code, the icons where only missing on
previous code.
Tried to modify and try, but can't get it to do what it say's on the
tin?
Chrism

mdipierro

unread,
Feb 15, 2009, 7:06:38 PM2/15/09
to web2py Web Framework
did you replace 'body' with the id of the textarea?

Massimo

murray3

unread,
Feb 15, 2009, 7:52:16 PM2/15/09
to web2py Web Framework
yes and it failed also!

mdipierro

unread,
Feb 15, 2009, 8:47:34 PM2/15/09
to web2py Web Framework
I do not know. That is used in applications/admin/views/default/
htmledit.html and it works.

murray3

unread,
Feb 16, 2009, 4:11:01 AM2/16/09
to web2py Web Framework
OK I used this code :
<script src="/{{=request.application}}/static/nicEdit.js" type="text/
javascript"></script>
<script><!--
$(document).ready(function(){
new nicEditor({fullPanel : true, iconsPath : '/
{{=request.application}}/static/nicEditorIcons.gif'}).panelInstance
('body');
});
//--></script>

and now works ok:)
thanks
chrism

Baron

unread,
Feb 17, 2009, 5:32:09 AM2/17/09
to web2py Web Framework
I had the same problem and your solution is better.
I edited the image path in the js file to '../../static/
nicEditorIcons.gif'
Reply all
Reply to author
Forward
0 new messages