Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-05 15:18:04

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

bot_show_image

Once activated, this minimal plugin will show the image associated with an article in the “write” tab.
Useful if you like to have a visual cue of the article image associated with the article you are editing (through the article-image field). If multiple article images are set only the first one will be shown.

Version: 0.2
the plugin provides some configuration options but, lacking an interface, you are required to change one or two values directly in the plugin code.
There are two options:

  • Display thumbnail instead of full image as per colak request
  • Set the width of the squared div that will contain the image (it defaults to 165px, the “write” tab columm width defined in textpattern css).

Version: 0.3
Fixes a bug

Version: 0.4
If multiple article images are set the first one will be shown (as per danwoodward request)

Download
bot_show_image_v0.4.txt

Last edited by redbot (2009-10-14 21:31:06)

Offline

#2 2009-01-05 15:28:41

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: bot_show_image

hi redbot,
sweet plugin

just installed it, is there a way to show the thumbnail version of the image instead of the full size one?

Last edited by colak (2009-01-05 15:28:55)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2009-01-05 15:58:35

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: bot_show_image

Hi colak,
actually half of the (short) plugin code aims at resizing and cropping the image in the assumption that generally the image is wider than a 165px square (165 px is the width of the write tab left column).
If you want to show thumbnails instead (which presumably are smaller than 165px) I suppose you won’t need to resize them (which in this case means enlarging them) so you have to strip all the code dealing with image resize.
Since I don’t want to add a preferences interface to this plugin (I haven’t the time) I encourage you to modify directly the plugin code.
If you can wait some hours (can’t do this now) I’ll show you how to modify it.

Last edited by redbot (2009-01-05 15:59:49)

Offline

#4 2009-01-05 16:29:20

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: bot_show_image

redbot wrote:

Hi colak,
If you can wait some hours (can’t do this now) I’ll show you how to modify it.

No prob, I’ve been living without this all my life:). Do advise me how to modify it when you get some time.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2009-01-05 20:14:34

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: bot_show_image

Haven’t tried this, but it may be a nice addition for some clients.

do you think it could be possible to add support for multiples ids on image field?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2009-01-05 22:59:13

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: bot_show_image

colak
Try version 0.2 (see the updated first post)

maniqui wrote:

…but it may be a nice addition for some clients.

Actually I did it for ‘some clients’ but then I found it useful myself (especially if used in a site with lots of articles).
Anyway, I’m sorry but I don’t plan to add multiple image support, this is an option I considered and discarded immediately because it would require too much effort and open to other potential problems (how do I display them? what if one has 30 article images?).
On the other side, you can safely use this plugin if you have only some articles with multiple images: in this case the plugin simply does nothing and avoids any mess but still works ok with single article images

Offline

#7 2009-01-06 07:11:53

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: bot_show_image

redbot, downloaded v.2, installed and all works just fine… Did not expect an update so quickly! Thanks.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#8 2009-01-09 13:00:32

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: bot_show_image

Sorry all,
version 2 had an error so it wouldn’t display the image as soon as an article was saved but only if opened through ‘recent articles’ or from the ‘articles’ tab.
Anyway version 3 fixes everything.

Last edited by redbot (2009-01-09 13:01:01)

Offline

#9 2009-03-09 23:01:18

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: bot_show_image

Just came across this the other day, but I already consider it a must-have plugin.

Thanks redbot!

Offline

#10 2009-03-09 23:39:01

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: bot_show_image

masa wrote:

…already consider it a must-have plugin.

Don’t exagerate! Anyway thanks, glad someone found it useful.

Offline

#11 2009-03-10 13:17:02

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: bot_show_image

redbot wrote:

Don’t exagerate!

I was being serious :-)

It’s so easy to forget assigning an article image since it’s only a number in a small input field. Also checking exactly which image a particluar number relates to can be time consuming.

Having an image thumbnail appear automatically makes it so much easier.

Offline

#12 2009-05-08 02:56:31

danwoodward
Member
From: Brooklyn NY
Registered: 2006-08-06
Posts: 51
Website

Re: bot_show_image

Great plugin

Would it be possible to make this compatible with upm_image? It works when there is a single ID in the Article Image field, but with multiple images it doesn’t show show anything. If it could just grab the first id in the string that would be very useful.

Offline

Board footer

Powered by FluxBB