Closed (duplicate)
Project:
Image Assist
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
5 Mar 2007 at 18:02 UTC
Updated:
8 Aug 2008 at 14:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
zoo33 commentedFirst: would it be sufficient for you to customize theme_img_assist_inline()? Or do you need the ability to choose for individual images if the title should be shown or not?
Anyway, I tested the patch and it works almost perfectly. The interface is nice with the checkbox on the side and the description below. (The table layout may not be the best solution, but that's another story, no use discussing that now.)
Personally I don't need the added window height, but that may differ a lot depending on circumstances.
One thing that actually doesn't work is the alt attribute itself – it's empty in the rendered html! (That's when using filter tag, haven't tried HTML.) I found this in theme_img_assist_inline():
So... the problem is: $caption is used for the alt attribute, but it's also printed beneath the image. So instead of altering how $caption is constructed (which the patch does) I guess we need to change the first line in the code above so that it does
$node->title = check_plain($attributes['title'])or similar.But then we're actually altering (a small part of) the behavior of the module. Would that be a problem? An alternative approach would be to have the checkbox decide if the whole $caption (which is the title + the description) should be printed or not, and leave the alt attribute as it is now. I think I'd prefer that actually.
Also, I noticed that your changes from back when you were fixing the original images are included in this patch, could you make a new one?
Hey, good work!
Comment #2
moonray commentedThanks for catching that. I could have sworn it was working properly.
New patch attached. Removed "original image" code (oops!), and fixed the alt attribute being empty.
Make sure you clear your cache after applying the patch.
DELETE FROM cache; DELETE FROM cache_filter; DELETE FROM cache_page;Comment #3
moonray commentedActually, this patch is against 5.1-1.x-dev
Comment #4
jaredwiltshire commentedGood idea. But I just tested the patch and the title doesnt appear for me when the "Alt only" box is not ticked.
Comment #5
moonray commentedWhat does your image tag look like? And did you clear all your cache after applying the patch?
Comment #6
sunPatch needs to be re-rolled against latest development.
Comment #7
sunMarking as duplicate of http://drupal.org/node/68661
Comment #8
adzio commentedPorted the patch to 6.2, fixed a typo.
Comment #9
perfectmatch commentedHi,
Am just applying the patch and am getting the following error :
Parse error: syntax error, unexpected T_STRING in ......... /public_html/x/modules/img_assist/img_assist.module on line 1646
elseif ($attributes['title']) {
- $caption = ''. $attributes['title'] .'';
+ $title = $attributes['title'];
+ if ($attributes['alt'] == FALSE) {
+ $caption = ''. $attributes['title'] .'';
Any ideas?
Thanks