Forum closed. New forum available at http://community.wymeditor.org/

Templates still work as in 0.2.2 ?

Support forum for WYMeditor.

Templates still work as in 0.2.2 ?

Postby maxloc on Wed Apr 23, 2008 6:52 pm

Hi all,

do Templates still work as in 0.2.2 ? On the wiki the templates aren't mentioned anymore in the 0.4 Customization section.


Regards,

Max
maxloc
 
Posts: 3
Joined: Wed Apr 23, 2008 6:39 pm

Re: Templates still work as in 0.2.2 ?

Postby jfh on Tue Apr 29, 2008 8:21 pm

Hi,

No, this feature isn't available since 0.3, and has to be rewritten.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Re: Templates still work as in 0.2.2 ?

Postby maxloc on Wed Apr 30, 2008 9:11 am

Too bad... where would I have to start when I'd try to implement it?

My concrete case is that I want users to be able to insert pre-defined tables by choosing from a dropdown or pop-up or similar.

Regards,

Max
maxloc
 
Posts: 3
Joined: Wed Apr 23, 2008 6:39 pm

Re: Templates still work as in 0.2.2 ?

Postby jfh on Wed Apr 30, 2008 8:56 pm

OK. Add a control (button, select, ...) using for example postInit (see custom button example in the package), and when the user chooses a value, execute something like:

Code: Select all
var container = wym.selected();
if(container && container.tagName.toLowerCase() != WYMeditor.BODY)
  jQuery(container).after( valueToInsert );
else
  jQuery(wym._doc.body).append( valueToInsert );


- 'wym' is the WYMeditor instance
- replace WYMeditor.BODY by WYM_BODY if you use 0.3 or 0.4.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests