WYM on Radiant

After putting WYM on Rails, WYMeditor goodness has finally made it to Radiant too! If you haven’t heard of WYM before, it beats the crap out of most RTE ’s qua keeping your content w3c valid. I quote;

WYMeditor has been created to generate perfectly structured XHTML strict code, to conform to the W3C XHTML specifications and to facilitate further processing by modern applications.

The extension replaces any radius tags with images that hold the respective radius code in their alt attribute. These are re-converted upon save or when you switch to another filter.

We use WYM in combination with page attachments. This gives us the luxury of drag-and-drop image inserting, clients totally dig it!

Install from

  
    
      svn://zuurstof.openminds.be/home/kaizer/svn/rails_stuff/radiant_extensions/wym_editor_filter
    
  
  http://github.com/jomz/radiant-wym-editor-filter-extension/tree/master
  • run rake radiant:extensions:wym_editor_filter:install
  • find out more about WYM on their website

No tests! so any feedback greatly appreciated

Update: The original svn repository is no longer being maintained. Have a look at the README on github.

In a reading mood?

I am in no way responsible for any sillyness going on below this line:

undefined tag `gravatar'

What about the Safari web browser? is it compatible?

undefined tag `gravatar'

Safari is supported, but to be honest we haven’t tested this thouroughly, so there might be some culprits..

undefined tag `gravatar'

Unbelievable… I’ve been using wym for awhile with my own CMS, but I think this combo might be the silver bullet.

undefined tag `gravatar'

The subversion repository doesn’t appear to work anymore; any chance of finding this somewhere?

undefined tag `gravatar'

weird.. i can still checkout here. Perhaps the wym repository has been down; there’s an svn:external to it.

If anybody wants to put up a mirror, go ahead and let me know, i’ll add the link here and in the readme

undefined tag `gravatar'

Hrm, weird. It does work now. Before I was getting “unreachable host” and 404 errors up the wazoo.

All’s well now, sorry to bug you. :-)

undefined tag `gravatar'

That’s ok, I’m glad everything works again.

undefined tag `gravatar'

Questions came up on the radiant mailing list about the drag & drop functionality. Thought it’d be best to share my answer here;

The ‘catch’ is that you first have to activate a container in WYM by clicking it, so you get the blinking cursor in there. Now you should be able to drop images to it. Beware; any html attributes that were given to the page_attachment thumbnail will also be copied to the wym one.

As for non-image drag & dropping, it works, but not on IE, and you need a little tweaking. see this pastie for our _attachment.rhtml. You’ll need to finish a bit to your likings, but i’m sure the pastie explains everything. The point is that you need a link to drag and drop into wym.

IE doesn’t allow you to d&d files because it doesn’t allow to paste links into wym. That’s what you do when you d&d a file; you again copy the image (file icon) and the tags that it has around it to the editor. You can then start typing the link text, and leave or delete the icon image.

Adding Radius tags seems to be allowed only in the code view, and editing these tags is difficult because WYMeditor adds a custom
tag to support tags appearing in the editor window.

Indeed, you can’t really insert radius through wym. When a page needs radius, i switch it back to filter. If the page is mostly radius, i leave it like that, if it’s a page that the end user might want to edit, i put it back to wym.

WYM doesn’t work on safari indeed, but we don’t see that as a problem. If we would have any clients on safari, i wouldn’t mind suggesting they switch to firefox. It’s still a back-end after all, and wym can be a great help to keep the front-end accessible for all browsers.

hope that clears things up a bit..

undefined tag `gravatar'

Hi everybody, I’ve got a problem with Wym editor. It works fine for snippets but is not working at all for normal pages. If I select the WymEditor filter nothing changes on the screen. Is there any solution to this? Of course the shards extension is installed.

Thanks in advance

Hi Tommaso,

It must still be a shards issue, because shards is used to get WYM going on the page edit screen, but not with the snippets.

Is shards also loaded first? (in environment.rb, config.extensions) Also, if you’re still on 0.6.4, you might have to rename the view files in shards; they should still be .rhtml, not .html.erb

undefined tag `gravatar'

I am getting the same issue as Tommaso. With Radiant 0.6.5, views renamed to erb.html – I can use wym with snippets but in page parts the textarea does not get replaced with the wym editor.

With firebug I get the following error in Firefox 2.0.0.13:

element has no properties:
getValue(null)prototype.js (line 3484)
getValue()prototype.js (line 3673)
initialize("part[1][filter_id]", function())prototype.js (line 3637)
klass()prototype.js (line 50)
[Break on this error] var method = element.tagName.toLowerCase();

I get the error twice (I have two page parts).

Anyway, thanks Benny for this extension – it looks great!

undefined tag `gravatar'

Hi Mark,

I don’t know right away what causes this, but i have WYM working on 0.6.5 myself, so it’s certainly possible. I wish i could help you out with this, but i’m drowning in client work at the moment..

I just read that WYM 0.5 should be released very soon now, i will then update the plugin and extension to work with this version, and perhaps write some more documentation..

undefined tag `gravatar'

Hi Benny,

It looks like the issue is Radiant 0.6.6 is outputting filter select tags with id=”part_0_filter_id” while WYMeditor is looking for the old style of id=”part|0||filter_id|” (| are actually square brackets, but I can’t post those here). I’ve fixed this for Pages but not for Snippets.

Here are the code fixes to get WYMeditor back up and editing Pages in Radiant 0.6.6:

snip

David

undefined tag `gravatar'

wonderful, thanks David! I hereby promise to put up my extensions on github so it will be easier to accept patches.

@readme.contributors << David Piehler ;)

undefined tag `gravatar'

Hi Benny,

Further to David’s changes, I’ve gone the next step and got things working for snippets under Radiant 0.6.6. You can check out the step-by-step here:

http://pastie.caboo.se/186091

Tim.

undefined tag `gravatar'

Tim—thanks for handling the Snippets fix, it works great. I’ll post this note on the Radiant mailing list as well.

undefined tag `gravatar'

I updated the extension with David and Tim’s patches. The extension is now also hosted on github; github.com/jomz/wymeditor-for-radiant

do let me know if you encounter any problems with it.

undefined tag `gravatar'

I’ve just created a new Radiant installation at version 0.6.7. This latest version has Shards built into its core so no extension needed!

I’ve added the fabulous WYMEditor and commented out line 7 in wym_editor_filter_extension.rb to make it work without having Shards installed as an extension (which causes problems in 0.6.7).

This all works fine. However, when I choose WYMEditor as the filter I get presented with no less than seven WYM editors!

Problem only occurs when WYMEditor is selected from the combo box. If I edit a page part whose filter is already set to WYMEditor then I only see one editor.

A Radiant (i.e. Shards) issue or something in WYMEditor for Radiant?

Installation: clean Radiant 0.6.7 (gem) with WYMEditor (rake radiant:extensions:wym_editor_filter:install run by turning off Shards requirement).

undefined tag `gravatar'

Hi Tristan,

I haven’t tried 0.6.7 myself yet, but i read about some issues with the core-version of shards in development mode. Does the problem persist in production mode? Also, do you happen to have seven page parts?

I’ll try out the extension with 0.6.7 as soon as i can, and fix it if the problem is in the extension. I’d say i’ll let you know when it’s done, but i tend to forget such stuff, so perhaps you should follow the extension on github..

Thanks for the feedback!

B

undefined tag `gravatar'

Benny,

I think the “multiple editors” problem is related to something to do with how the new shards is injecting partials. I am working on an FCKEditor extension and a tester has given me the same feedback for a 0.6.7 instance running on leopard. I was able to discover that multiple copies of content I was injecting into the “part_control” region were being put in, causing multiple FCKEditors to be created.

Unfortunately, I haven’t been able to reliably reproduce the situations this happens under. But at least it’s a place to look.

My stuff is at:

github.com/djcp/radiant-fckeditor/tree/master

—DJCP

undefined tag `gravatar'

Hi Dan, Tristan,

The issue lies indeed with the new way that shards works. This has been fixed in the trunk version, so rake radiant:freeze:edge should get rid of this problem.

Regards,

B

undefined tag `gravatar'

I pulled the latest code, commented out the line requiring shards and I get 6 editor instances. In comment 21 you say to do rake radiant:freeze:edge, but on my version there is no such rake task. Did you mean rake rails:freeze:edge?

Can you explain what the fix is?

undefined tag `gravatar'

Hi Jason,

I really meant rake radiant:freeze:edge; The issue lies with the shards functionality in the core of the 0.6.7 release. This has been fixed in the trunk version of Radiant, so freezing it to edge will fix you problem.

If you don’t have the radiant:freeze task, then there’s something wrong with your Radiant instance. How did you install that?

undefined tag `gravatar'

Greetings guys..

I’m trying WYM Editor with radiant 0.6.7

I’d say i liked WYM editor a lot although i had some trouble getting it to work correctly.

I had an issue with the installation as it wasn’t clear on the readme file on github There should have been the line “git clone git://github.com/jomz/wymeditor-for-radiant.git vendor/extensions/wym_editor_filter” it wasn’t there and i cloned the repository as “wymeditor-for-radiant” which lead to some problems for a while. Anyway, i got that fixed and got the wym editor running in radiant.

A very strange thing is that, instead of loading the default language “en”.. it loads the strings from “nl.js”… tracking the javascript files i found that “en” is set as the default language, i couldn’t find out why it is loading the wrong language till now… anybody has a clue???

Thanks

undefined tag `gravatar'

Hi modsaid,

In order to load the english strings, you’d have to change radiant.wymeditor.js, which was copied to /public/javascripts by the rake install task. In the boot_wym() function, comment out or remove this line:

lang: 'nl',

You are right about the folder name not being correct when you git clone without a target. I forgot that not everybody has the same amount of experience with Radiant to figure that out.. I’ll update the README, thanks!

undefined tag `gravatar'

Anyone got it working with Radiant 0.7.1 ? I fixed that “default partial not found!” error but still no editor :(

undefined tag `gravatar'

Hey Benny!

I would LOVE to use this extension but unfortunately it’s not working in 0.7.1.

Any plans to add support?

thanks!

undefined tag `gravatar'

Hey Cristian, wooter,

Sorry for not noticing your comments earlier. I presume that you both installed the extension from the original subversion repository. That version has been abandoned, since git-svn and submodules don’t get along too well.

I updated the article with the github url, please go there to find a newer version that works with 0.7

undefined tag `gravatar'

Hi Benny, I am using WYM 0.4 version on Radint 0.7.1. I am getting the following issues:

1. I see 2 editor windows. 2. If I had a Textile filter and change to WYM, and then if I flip back to Textile, all line breaks are lost. 3. Using tables is a pain. I could not find a way to resize columns or the whole table.

Let me know if you can help.

undefined tag `gravatar'

Hi Rupak,

1: fixed; i had tried to fix an issue for radiant 0.8, but just reverted that change

2: it’s not a good idea to switch between textile and WYM anyway; WYM will not know what to do with textile, and like you pointed out; wym re-formats the HTML

3: from a standards-driven viewpoint, it is undesirable to size your table (columns) through the editor, as that would require inline styling.. if you absolutely need to set the table (columns) ’s width, you’ll have to work with CSS classes…

HTH

undefined tag `gravatar'

Hey Benny, I love the extension. Really great stuff. I am having a problem trying to figure out how to add additional classes to the container on the right hand side. Is there a single file that I’m supposed to edit? I know there has to be an API for this somewhere, I just can’t find it.

Also, the page preview extension breaks the WYMEditor’s binding to the text area when it loads the page into an iFrame… not sure if there is a way around that or not.

Thanks!

undefined tag `gravatar'

Hi Jon,

You can add extra classes in radiant.wymeditor.js, line 109 for the current version. Add new classes in the classesItems array, and be sure to use the correct syntax.

The editorStyles array below it, is for visual feedback in the editor itself, i.e. you could add a red border around a container with the class you added above. This is not required.

I am aware of the WYM + page preview problem, it’s on my to-do list.. keep an eye on the project’s github page ;)

Regards,
Benny

undefined tag `gravatar'

Hi Benny,

Awesome plugin. I’ve just started out with Radiant and stumbled over WYM while browsing the extensions repository at radiantcms.

I have one small problem with the plugin on FF and Safari: Overflow doesn’t seem to work propperly. If the text im typing gets to big, the scrollbar doesn’t show up. Works perfectly in IE6 and IE7 though.

I would realy appreciate anny help/insight/css voodoo you could come up with ;).

Regards from Switzerland,
Eddie

undefined tag `gravatar'

Hi Eddie,

that’s weird, the expanding of the editor works fine for me on both FF and Safari..
Could you please elaborate a bit more?
Are you sure you are using the latest version? Have you been tweaking the editor css perhaps?

undefined tag `gravatar'

Hi Benny,

I found that the wymiframe.css file contains:

html { overflow: hidden; }

which will clip the content. I’m playing with this under Radiant 0.9 and it works in broad terms, but has problems with preview and image insertion (using 0.9.0 branch of Paperclipped).

Cheers,
Si

undefined tag `gravatar'

Hey Simon,

Sorry for my timely response, i’ve been out due to sickness..

I still haven’t found the time to make my extensions 0.9-proof. Any help or patches would be greatly appreciated..

Regards,
Benny

Comments are closed for this article.

About this article

You’re reading an entry titled “WYM on Radiant”. Written

undefined tag `time_ago_in_words'
ago (31/10/2007) — and archived under editor, extension, radiant, WYM. So far, 36 people (dis)agreed with me, what do you think?

What the fuzz is all about

  1. 2 pages are tagged with WYM
  2. 1 page is tagged with absolute-urls
  3. 1 page is tagged with arrrrcamp
  4. 2 pages are tagged with documentation
  5. 2 pages are tagged with editor
  6. 2 pages are tagged with extension
  7. 2 pages are tagged with extensions
  8. 1 page is tagged with minitorial
  9. 1 page is tagged with navigation
  10. 10 pages are tagged with radiant
  11. 4 pages are tagged with rails
  12. 2 pages are tagged with ruby
  13. 2 pages are tagged with shell
  14. 1 page is tagged with sifr
  15. 2 pages are tagged with troubleshooting

Github activity

More places where you can find me

Back to top