Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-04-03 21:24:12

mwaldtha
Archived Plugin Author
From: Colordao
Registered: 2006-04-02
Posts: 19
Website

4.0.3 (r1188) - article_image does not apply 'style' or 'align' attrs.

I’ve found that the artilce_image tag does not apply the ‘style’ or ‘align’ attributes if the article image field contains a URL instead of a numeric ID value. From taghandlers.php (line 1215):

<code>
if (is_numeric($theimage)) { $rs = safe_row(“*”,‘txp_image’,“id=’$theimage’”); if ($rs) { extract($rs); $out = array( ‘<img’, ‘src=”’.hu.$img_dir.’/’.$id.$ext.’”’, ‘height=”’.$h.’” width=”’.$w.’” alt=”’.$alt.’”’, (!empty($style)) ? ‘style=”’.$style.’”’ : ‘’, (!empty($align)) ? ‘align=”’.$align.’”’ : ‘’, ‘ />’ ); return join(’ ‘,$out); }
} else { return ‘<img src=”’.$theimage.’” alt=”“ />’;
}
</code>

Obviously, if $theimage is not numeric the else block will be executed and the output img element will contain just the ‘src’ and ‘alt’ attributes. The documentation over at the TextBook Project does not state that the ‘style’ and ‘align’ attributes are conditionally applied, so I think that either the documentation needs to be updated, or preferably, the tags attributes should be applied in both cases.

Thanks,
- Marc

Offline

#2 2006-04-04 02:58:39

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: 4.0.3 (r1188) - article_image does not apply 'style' or 'align' attrs.

Welcome to the forum, Marc.

Thanks for letting us know, it is a known problem (and yes, we need some better tracking of these things than the forum…). :)

Offline

#3 2006-04-04 18:11:24

mwaldtha
Archived Plugin Author
From: Colordao
Registered: 2006-04-02
Posts: 19
Website

Re: 4.0.3 (r1188) - article_image does not apply 'style' or 'align' attrs.

Sorry for missing that post. I just searched this specific forum before I posted. I hacked a fix for my environment, but it is good to know it will be oficially fixed.

Thanks,
- Marc

Offline

Board footer

Powered by FluxBB