Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-20 09:45:54

helge
New Member
Registered: 2006-03-05
Posts: 6

article_image ignores attributes of http-source images

Hello Textpattern Team.

I’m Using this tag: <code><txp:article_image align=“center” style=“border:1px solid #E6E6E6; float:right; margin:1em 1em 0.5em 0.5em;” /></code>

If I’m using Image-ID “2” as Article Image in “write -> Advanced Options -> Article image” the Output code is:
<code><img src=“http://localhost/images/2.gif” height=“69” width=“316” alt=“abc” style=“border:1px solid #E6E6E6; float:right; margin:1em 1em 0.5em 0.5em;” align=“center” /></code>
All attributes are outputted correctly.

By replacing the Article ID in “write -> Advanced Options -> Article image” with the corresponding URL <code>http://localhost/images/2.gif</code> the output code is:
<code><img src=“http://helge.mandulis.de/images/2.gif” alt=”“ /></code>
As you can see, in this case, there are no Attributes in the output HTML-Markup.

<code>Version Textpattern: 4.0.3 (r1188)</code>

Offline

#2 2006-03-20 22:58:17

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

Re: article_image ignores attributes of http-source images

That’s not a bug, it specifically doesn’t do that.

Offline

#3 2006-03-21 06:05:30

helge
New Member
Registered: 2006-03-05
Posts: 6

Re: article_image ignores attributes of http-source images

Oh. Why does it do so?
Perhaps I’m overlooking something, but to my mind that’s impractical.

Offline

#4 2006-03-21 07:03:50

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

Re: article_image ignores attributes of http-source images

Off-hand, the images managed by Textpattern have their data stored in the database, so it is fetched from there. Outside images don’t have this data stored anywhere.

Now, that’s not to say that you couldn’t have Textpattern read the image data that it can read (width and height), if your install of PHP supports that (you’d need to have url_fopen enabled). No one’s patched this yet, that’s all, hence, I moved this to “Feature Ideas”. I’ll work on a patch for this tomorrow.

Offline

#5 2006-03-21 07:41:59

helge
New Member
Registered: 2006-03-05
Posts: 6

Re: article_image ignores attributes of http-source images

Hi!

It is not so important to have <code>width</code> and <code>height</code> available, but it would be important to have the <code>style</code> (and <code>align</code>) attribute(s) of the txp-tag applied.

Offline

#6 2006-03-22 01:57:32

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

Re: article_image ignores attributes of http-source images

I couldn’t tell you the original reasoning (there may not have really been one), this tag is fairly old, from long before I was around here. I can tell you that (from the perspective of the code) it’s not that it should contain those attributes, but something goes wrong, rather that the whole process gets skipped for url article images.

I agree that this tag should be improved in the manner being requested, and it is fairly easy to do so. I’ve just completed the patch, and I’m sending it in now.

(Edit: bah, forgot about it for a couple days, just sent it in now.)

Last edited by Mary (2006-03-25 07:51:27)

Offline

Board footer

Powered by FluxBB