First thanks for this fantastic module!

In the configuration settings it states: "Note that only file fields that use the "Image" widget type support ImageCache configuration options."

I was wondering whether it is in the works to have support for ImageCache configuration options where the File field is not an Image widget type but a more generic File Upload field?

My thinking behind this is that I could have a generic File Upload field for users. I am also experimenting with using image cache to generate thumbnails of pdf files and the option to insert these imagecache generated thumbnails would be useful.

Comments

quicksketch’s picture

This is a reasonable request but something that'll take some work to get working adequately. It doesn't make sense to show the ImageCache select list when ImageCache doesn't support the file that's been uploaded (such as videos or text files), so we'd need to make FileField Insert show the ImageCache list only for certain file types.

KG2’s picture

Thank you for your informative reply. I'm so glad you found my request reasonable (as a non-programmer I often get insecure about posting on drupal), however the more I think about it the more unreasonable my request is starting to feel.

What I believe I was envisioning for Filefield Insert is more Filefield display options at the end user per node level (some generated by ImageCache, others by modules such as SWF Tools for audio and video), and
to use the Filefield File Upload widget for images (as I do for mp3s, flvs, pdfs) - rather than the Filefield Image widget.

This would mean that the end user could upload multiple files of different file types in a single CCK File Upload field - and could display these files inline in ways that make sense for the file type.

I realise now that this request has ramifications far beyond the ambit of the Filefield Insert module.

For instance following my logic would mean that the CCK Imagefield module could be replaced by the Filefield module - and this would probably not be feasible as other contributed modules rely on the Imagefield module.
(ImageCache, however, does not appear to need the Filefield Image widget to work. Images uploaded using the File Upload widget can still be configured to display ImageCache presets in the content type's administration section - but not at the node level when using the Filefield Insert module.)

To reiterate I suppose my feature request was this: Would it be possible for the Filefield Insert module to have display options available when using the Filefield Upload widget (in my case I would like display options not only from Image Cache but also from SWF Tools).

But perhaps I should be focusing on the node template and not considering giving the end user such inline display flexibility at all?

Apologies for this ramble. Thanks again for your reply and a great module.

quicksketch’s picture

A list of different formats for inserting would indeed be a nice capability, but it's something that would require a massive undertaking. ImageCache presets are available to images because inserting the markup for an ImageCache preset is trivial (just change the "src" property of the IMG tag). Unfortunately doing the same thing for other data types is not nearly so obvious. SWFTools provides a great number of ways to output different files, but unfortunately it's very difficult to know when to use which format.

The ideal solution would be to have something like Inline module do the conversion for us on the PHP side, since it's already capable of doing things similar to what you're describing. However, Inline module relies on special tags like [image:something.jpg] or [video:myvideo.mpg]. The result of this is that you don't get the file displaying while editing in a WYSIWYG, it's only shown on output.

So to finish your request in its completeness would require a significantly different approach than FileField Insert currently uses (not to mention a lot more code overall), so I don't think it will be possible at least for the initial release of the module.

sun’s picture

Duplicate of #461220: Implementing functionality like this as a filter? ?

Heh. Here even more concrete. Inline API indeed will allow other modules to just define their macro tag, parameters, and rendering function by implementing hook_inline(). If desired, Inline API also takes over Wysiwyg API integration, which means: You get a dialog for free. And you get cross-editor support for free. :)

I already implemented a module exposing a few custom inline macros for a site recently - the results were quite amazing!

quicksketch’s picture

Project: FileField Insert » Insert
Version: 6.x-1.x-dev » 6.x-1.0-beta1
Status: Active » Fixed

The new Insert module now provides universal support for files with all defined insert styles, even though it might not make sense in all situations. It's currently left up to the administrator to decide which styles make sense for their fields (similar to selecting Formatters).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.