I'm trying to figure out a way to help TinyMCE understand the internal: syntax used with pathfilter when it renders images within the editor itself. I need my WSIWYG to WSIWYG fully. :)
I added the function in the pathfilter readme to my theme (to set $init['convert_urls'] = 'false';), so TinyMCE is not goofing up my pathfilter-dependent URLs. I can furthermore insert images by entering the internal:.../image.jpg path just fine; the resulting HTML output from TinyMCE is fine, and the rendered node is fine.
The only problem is that TinyMCE doesn't know how to interpret the internal: bit in order to render the images when I'm actually using it to edit a node. The result is a broken image link in the editor when an image is first inserted (which I could live with) but nothing at all after the node has been saved and re-opened in TinyMCE. (The image tag is still there in the node as it should be; it's just invisible within the editor.)
A solution would be to spit out the appropriate value in some on-the-fly js when the page is loaded (something like var pathfilter_internal_path_prefix = "http://mysite.net/path/";). I could do that just fine, but I don't know how to tell TinyMCE to reinterpret internal: in the image src attribute as that value.
It's a TinyMCE question and not a Drupal one, really, but perhaps someone else has tried to do the same thing already. I've scoured the TinyMCE documentation but not found anything that looks like it would do the trick. I even tried looking in the TinyMCE source JS, but that was a nightmare.
For reference (and perhaps for posterity if I get an answer), here's my post on the TinyMCE forums:
http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=17918#p17918
Comments
Er, um, uh... WYSIWYG.
Er, um, uh... WYSIWYG. :)
=======================
Just another newbie.
XHTML Strict: it's the way to be.
=======================
Feature request: HTML Source Formatting in TinyMCE
A simpler solution would be
A simpler solution would be for TinyMCE to merely display a filler image or a single block containing text like "IMAGE with path..." If this represented the broken image link, the user could see it and delete it. That's enough of a workaround for me.
=======================
Just another newbie.
XHTML Strict: it's the way to be.
=======================
Feature request: HTML Source Formatting in TinyMCE
Write plugin for editor or Patching pathfilter
I have been working on this issue for a day or two. Here are my ideas for tackling it:
I'm not sure if we need to keep track for instances where a string had base_path originally, and does not need to be translated to 'internal:'
EDIT: I've submitted a patch to the pathauto module to perform the second operation automatically.