As filefield_insert inserts webroot-relative paths of files/images, and not drupal-relative ones, it is quite difficult to deploy a dev site built in a subdir to a webroot. inline.module follows another approach: it inserts/awaits an [inline:filename] "tag" to the node body (or something similar), and replaces it via hook_nodeapi() - so one does not have care about any path, but the filename itself. Anyway, I don't know if it places too much burden on the server while rendering pages this way. Maybe a proper filter module (which does the replacing at node save, and not node view) would be better, as all one has to do when deploying is cleaning off the cache.

Is it possible to have some functionality with regards to the above description?

Comments

quicksketch’s picture

Yep, it's definitely possible to a certain extent. Currently FileField Insert is targeted around working with WYSIWYG editors, since if your users can't copy/paste a URL, they probably can't type HTML either. Currently there is no Inline-like solution that works well with WYSIWYGs as far as I know. However, it should be possible to simply override the filefield-insert-image.tpl.php file to make it use a Inline-syntax instead.

Either way though, a filter will NOT ever be added to this module. If a reasonable filtering system exists that works with WYSIWYGs, making it a configuration option or somehow inspecting the selected input format might be an option. There are already several solutions out there at the filtering level to solve this problem, and I'd prefer to let them figure it out.

Finally, just an obvious suggestion to fix the dev/live situation: just set up a virtual host on your localhost so that the site is installed at the root of the virtual host, so "http://example/" goes to local and "http://example.com" goes to live. Then you won't have this problem to begin with.

sun’s picture

Shoot! Now I figure what module this was all about ;) Nice!

FYI: Allowing modules to implement arbitrary inline macro tags with built-in support for client-side editors is exactly where I am heading with Wysiwyg API + Inline API (+ partially Image Assist, as of now).

Trunkhorn’s picture

So, to make it relative, would it be as simple as changing print $url to print $file->filepath?

ao2’s picture

Hi, for those who want to have a filter solution equivalent to FileField Insert, you could base it on #394682: CCK fields (filefield,imagefield,emfield) and fieldgroups for Inline API when it will be ready. Sorry for advertising a little :)

Regards,
Antonio

quicksketch’s picture

Status: Active » Closed (fixed)

This module probably isn't the correct place for such functionality, Inline is much more appropriate. I'm closing this issue to clean out the queue and move everything to the new Insert module, which will be replacing FileField Insert.