Allow to define ImageCache preset per inline tag
ardas - July 24, 2008 - 16:52
| Project: | Inline |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
Greetings,
I would like to propose you a patch which implements an ability to specify imagecache preset inside inline tag instead of just having one global setting for all tags.
This patch doesn't break existing functionality but now a user can use imagecache preset inside inline tag. This will give an ability to use various presets depending on images.
Usage:
with title [inline:image-file-name.jpg=Image Title=preset-name]
without title [inline:image-file-name.jpg==preset-name]
The patch was created against the latest 5.x-1.x-dev release. Please review and consider to apply it to both 5.x-1.x-dev and 5.x-2.x-dev branches.
Thank you.
| Attachment | Size |
|---|---|
| inline-imagecache.patch | 1.79 KB |

#1
This won't fix in 5.x-1.x, but would be a valuable addition for inline_upload module in 2.x (Inline API).
#2
Subscribe
#3
I have patched the latest HEAD of 6.x-2.x-dev to allow for inline imagecache preset override. The new format is:
[inline|file=01.jpg|title=Some Title|imagecache=alternative-preset]
If the imagecache parameter is not set, it will fall back to the default.
#4
After applying this patch, I no longer see the image inline -- just the title of the image linked to the image file. This is with no changes to the syntax. If I reverse the patch, I get the images showing up in the nodes again.
#5
tony, this is without changes to syntax? So your inline tag still looks something like:
[inline|file=01.jpg|title=some text] ?
#6
Yes, except inline_upload instead of inline.
#7
Whoops, mine is also. For a moment there I thought "Wait.... how did I code my inline tags."
Are you certain that w/o the imagecache parameter [inline_upload|file=01|imagecache=tiny-preset] That it is still using imagecache and not just displaying the default image?
Upload an image, check the url that is displayed directly under the description down in the "file attachments" section of the node edit. Then insert it using [inline_upload|file=filename.jpg]. When the image is properly displayed in-line, right click on it and select view image. Verify that the image is coming from a directory such as: http://yoursite.com/sites/all/files/imagecache The important item is "imagecache" if you don't see that in the path, then imagecache isn't being used, and you have something to troubleshoot before trying to do a parameter override of the imagecache preset.
If it is properly displayed let me know. I'll do a fresh drupal install and see if I can get my patch to work or not.
#8
Yes, it looks to me like it's the imagecache image that's being served. Here is what the HTML source before I apply this patch:
<a href="/sites/site.example.com/files/luau.jpg" class="inline-image-link" title="View: Luau"><img src="http://site.example.com/sites/site.example.com/files/imagecache/300/luau.jpg" alt="Luau" title="Luau" class="inline" width="300" height="212" /></a>and here's what it looks like after the patch:
<a href="/sites/site.example.com/files/luau.jpg" class="inline-image-link" title="View: Luau"><img src="http://site.example.com/sites/site.example.com/files/imagecache/300/300" alt="Luau" title="Luau" class="inline" /></a>Notice, the filename of the tag disappears after I apply this patch (well, technically, it's replaced by the imagecache preset name, in this case, "300".)
#9
I have the same behavior. Subscribing.