Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-12-12 18:11:05

jameslomax
Member
From: UK
Registered: 2005-05-09
Posts: 448
Website

show image in admin article page

There are a number of plug ins which display images in various parts of the admin pages – which you otherwise wouldn’t see.

Is there a plug in which will display the associated image /s in articles, on the article page?

If you run a photo based or image heavy site this will be very useful.

Offline

#2 2015-12-12 20:34:13

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

Re: show image in admin article page

It would be ideal for your site, James, I agree. When I helped you many moons ago, I thought that too, but as far as I remember your site doesn’t (or didn’t at least) use article images or another separate custom field to hold the image id, but instead embeds the image using a tag in the body field. The usual image plugins won’t work in this case.

If things have changed since, and your images are now stored in the article image field or another custom image field, you should be able to use bot_image_upload or rah_pin.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2015-12-13 01:35:33

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: show image in admin article page

jakob wrote #297068:

If things have changed since, and your images are now stored in the article image field or another custom image field, you should be able to use bot_image_upload or rah_pin.

Or mck_article_image

Offline

#4 2015-12-13 09:57:58

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: show image in admin article page

Because there are multiple ways to insert an image into an article, there is not one solution that covers this. In v4.7 my work is to improve image ui in the system – but even then there are limitations as to what can be done.

Offline

#5 2015-12-13 10:21:53

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

Re: show image in admin article page

Good find GugUser. Didn’t know that one.

James, as far as I remember your site has a upm_image tag in the body of each article which outputs the image within each article. The plugin served a need that has since long been superseded by txp’s own image tags. I think the article image field existed back then but Mary must have had a reason for doing it that way at the time (maybe so you could place the image where you wanted in the text). To display an image on the write pane, a plugin would have to extract the id within that tag in the body (and ideally respond to it if you changed it). None of the aforementioned plugins do that.

I’m not sure if your site is still organised that way or whether you have migrated in the meantime to using the article image field. If still using upm_image, I would say it would probably make more sense to re-organise how image handling is dealt with on your site. Given the vast number of images you have, that would probably be easier to do through a custom-written script that extracts the first instance of that tag from each article, places the id in the article image field and regenerates the saved html output (the body_html field) … or by alternatively massaging a dump of the database. Editing the hundreds (thousands?) of entries manually would be rather tedious…

EDIT:

Is there a plug in which will display the associated image /s in articles

Only just saw this: the last time I looked, there’s not an easy way of showing a thumbnail in the article list view (i.e. in Content > Articles). That page also does not offer built-in ways of changing the output via a txp plugin. As I needed this a while back for a painter’s site, I hacked the core to do that, but here too I was using the article_image field to show the image. The other non-hack way to do something similar would be to make a separate pane (using smd_tabber) listing articles with their images.


TXP Builders – finely-crafted code, design and txp

Offline

#6 2015-12-13 10:44:29

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

Re: show image in admin article page

philwareham wrote #297071:

Because there are multiple ways to insert an image into an article, there is not one solution that covers this. In v4.7 my work is to improve image ui in the system – but even then there are limitations as to what can be done.

Really looking forward to that: bot_image_upload works but normal users still find it confusing with the image pane in the popup. I’ve mostly rejigged the css for that because users were not finding the extra tick box.
It would be great to bring other thumbnail sizes into the txp core too (i.e. smd_thumbnail core-ified) – your new image edit pane on the admin already provides a good start for that.


TXP Builders – finely-crafted code, design and txp

Offline

#7 2015-12-13 20:20:50

jameslomax
Member
From: UK
Registered: 2005-05-09
Posts: 448
Website

Re: show image in admin article page

OK thanks. I did install Mary’s upm plug in because at the time it was a superb advance for image handling. I think everyone thought that :-) However – even with my limited understanding I thought using the upm code for every image could mean problems in the future. So I never did that; it also gave you option to output txp code. And I stopped using the plug in entirely a few years ago when there were better alternatives.

I currently manually insert this for example at the top of every article:

<txp:image id=“3396” />

And this in the excerpt field:

<txp:thumbnail id=“3396” />

It’s clumsy and laborious, but because its a minimal use site it’s not a great problem for me to do that.

There might be a slight problem too with the article image field: because about 6 months ago I started using arc_twitter to produce Twitter ‘cards’ which requires you to insert the image id. for the card into that field.

mck_article_image is working nicely when I insert an image id. I tried bot_image but there’s a conflict – because it takes the place of the article image field.

Offline

#8 2015-12-15 10:41:39

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

Re: show image in admin article page

jameslomax wrote #297077:

… I tried bot_image but there’s a conflict – because it takes the place of the article image field.

Hi,
FYI the plugin let’s you use every custom field you like (even multiple fields). Read the instructions to configure it.

Offline

#9 2015-12-15 20:35:16

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

Re: show image in admin article page

{####} is working nicely when I insert an image id…

Yes, you may see the image in the write pane but if your output form for the front end doesn’t do actually do anything with the article_image it will be purely cosmetic (literally a visual reminder for you). You can test that by changing the attached image with mck_article_image or bot_image_upload and then seeing if that change is reflected on the public facing page?


TXP Builders – finely-crafted code, design and txp

Offline

#10 2016-02-28 10:15:31

jameslomax
Member
From: UK
Registered: 2005-05-09
Posts: 448
Website

Re: show image in admin article page

Yes I think it is only cosmetic. It doesn’t change the way the site works, as such. Still – it’s a slight improvement being able to see which image appears in an article.

Offline

Board footer

Powered by FluxBB