Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2006-06-20 16:36:29

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,752
Website

Re: hak_article_image

Using this for the first time and it’s a joy to use for simple output. One quick question:

In the code that is output an individual space is output between the li and img tags , i.e. <li> <img src =""> </li> and this makes IE pad things out. I can get around it by setting fixed values for height and overflow:hidden; but I’d rather not. I tried digging around in the code but couldn’t find out why. Perhaps you have a quick pointer.


TXP Builders – finely-crafted code, design and txp

Offline

#50 2006-06-20 18:20:46

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

The space seems to be coming from the built in image and thumbnail functions which hak_article_image accesses, so unfortunately there is not really an easy way to get rid of it.

I can’t recall having seen space on the same line affect height in IE before though. If the <li> was on it’s own line I’ve seen that. I have found playing with the line-height can deal with those weird IE height paddings on <li>’s though.

Sorry I don’t have a real solution.


Shoving is the answer – pusher robot

Offline

#51 2006-06-20 18:52:21

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,752
Website

Re: hak_article_image

hakjoon, you’re right: it seems to be the line return join(' ',$out); at the end of the function thumbnail in taghandlers.php. It adds a space between the different elements when building the html. Changing it to return trim(join(' ',$out)); solves it by trimming away preceding or trailing spaces but it’s hacking the txp code.

Alternatively one could add ' ' to the beginning of the individual attributes in the thumbnail function (as already the case with ' alt=, i.e. ' align and ' style and ' />'…) and take the space out of the join statement altogether.

On another note: I added a further attribute to your plug-in code imglink="1" to link simply to the large image. Then you can use it to build clean thumbnail lists for use with unobtrusive js scripts like thickbox etc. In this case I wanted to do something similar to the jpop in rss_thumbpop but without the inline onbehaviors (and as chance would have it jeremy keith described just that today on ALA, which was very handy). If you’re interested I can mail or post it.


TXP Builders – finely-crafted code, design and txp

Offline

#52 2006-06-20 19:03:11

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

You could probably change these lines in hak_article_image to get rid of the space.


$out[] = image(array("id"=>$id));

to

bc..
$out[] = trim(image(array(“id”=>$id)));

and same with


$out[] = thumbnail(array("id"=>$id, "poplink"=>$poplink));

to


$out[] = trim(thumbnail(array("id"=>$id, "poplink"=>$poplink)));

I’ve been debating writing my own image and thumbnail functions for the next version so i can rel attributs and the like. Maybe I’ll have to afterall.

Definitely Send me or post your stuff I’ll add it to the plugin.


Shoving is the answer – pusher robot

Offline

#53 2006-06-20 19:45:06

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,752
Website

Re: hak_article_image

yes, good idea. That works for all but poplink, which is an internal part of the thumbnail function in txp. I’ve sent you a mail with the other bits.


TXP Builders – finely-crafted code, design and txp

Offline

#54 2006-07-14 09:15:28

beztak
Member
From: Czech Republic
Registered: 2005-07-21
Posts: 184
Website

Re: hak_article_image

Hi Patrick, after resolving tinymce problems, I search for another useful plugins and again it’s yours (you’re good). This time I use this syntaxe:

txp:hak_article_thumb limit=“3” poplink=“1” /

But when I don´t have thumbnail uploaded in TXP, no image (in the original size) is displayed instead. I need this: When thumbnail is uploaded, than it works well, it displays this thumbnail with popup link. But I need to display all other images they haven’t their thumbnail without link, just img src=”“ alt=”“ It is possible?

And the second question is, if you can add some function to display specific one images, if article_image’s field is empty at all? Like “no-image.gif”?

Offline

#55 2006-07-14 12:33:00

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

Hey Beztak,

I don’t think there is a way to do the first one. The plugin uses <txp:thumbnail /> which I don’t think behaves that way. I’ve been planning a re-write to use my own image handling functions but I’m not sure when I’ll be able to get to it, as I’m in the process of getting ready to move in a couple weeks.

For the second one I use tcm_if_article_image to check for article_images. You’d probably want to take a look at obeewan’s modified one (linked from page above).


Shoving is the answer – pusher robot

Offline

#56 2006-07-24 02:03:33

reptilerobots
Member
Registered: 2005-08-20
Posts: 72

Re: hak_article_image

I am getting a space between my thumbnails. After looking at the output html, there’s spaces where I wrote space.. (how obvious) …. is there a way to fix that? I changed my plugin code as it was mentioned above.
<code>
<a href=“http://www.wearetherobots.com/pages/images/3.jpg” onclick=“window.open(this.href, ‘popupwindow’, ‘width=500,height=617,scrollbars,resizable’); return false;”> <img src=“http://www.wearetherobots.com/pages/images/3t.jpg” alt=“gravetemple trio” /> </a>
<a href=“http://www.wearetherobots.com/pages/images/2.jpg” onclick=“window.open(this.href, ‘popupwindow’, ‘width=785,height=525,scrollbars,resizable’); return false;”> <img src=“http://www.wearetherobots.com/pages/images/2t.jpg” alt=“wolfmother” />SPACE</a>
<a href=“http://www.wearetherobots.com/pages/images/4.gif” onclick=“window.open(this.href, ‘popupwindow’, ‘width=738,height=738,scrollbars,resizable’); return false;”> <img src=“http://www.wearetherobots.com/pages/images/4t.gif” alt=“sts” />SPACE</a> <p>test 2</p>
</code>

http://www.wearetherobots.com/pages/news is the page and ignore the really ugly colors! thanks !

Offline

#57 2006-07-24 02:49:01

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

There currently isn’t anyway to to get rid of that space when using poplink without hacking the TXP core code. (see post 51)

You could always try floating your images which should at least remove the visual space.


Shoving is the answer – pusher robot

Offline

#58 2006-07-24 04:21:06

reptilerobots
Member
Registered: 2005-08-20
Posts: 72

Re: hak_article_image

thanks, I didnt realize floating would close gaps.

Offline

#59 2006-07-24 07:56:41

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: hak_article_image

Hak, did you get the image anchor implemented (as to stop the page jumping to the top each time)?

Offline

#60 2006-07-24 13:15:32

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

Not yet. I haven’t had a lot of time to work on TXP lately, but I might be able to get an update with some of these issues that don’t require a new image routine out this week. Let me see what I can do.


Shoving is the answer – pusher robot

Offline

Board footer

Powered by FluxBB