Jump to content

Displaying thumb image of upload field in Pages


Kirill Gromov

Recommended Posts

Wow! Indeed! 

59cd0a51b7b61_Bildschirmfoto2017-09-28um16_41_52.thumb.png.2ec752fabd92ec4f405dd2a294505ebe.png

When was that added? If these things are not in the release announcements, there should be posts in the feedback forums telling us that they were added. Same with “https images for older post content”. I keep waiting for these features and have no idea they are there already. 

Link to comment
Share on other sites

12 minutes ago, opentype said:

I haven’t tested it, but Daniel’s call will probably produce a processed output with complete HTML, not an individual file URL. So you can’t call that within the img src attribute. Try to output it by itself and see what it does. 

I have already tried to do this, it does not display anything

Link to comment
Share on other sites

4 hours ago, Daniel F said:

I'm sorry this method returns an array

@Daniel F Thanks, it works, BUT show thumbnail of last record in the database. I checked the table that stores thumbnails of the uploads field and I see only one record!! Thus, as soon as a new article is added to the database, the thumbnail is overwritten, and the old one is deleted. This is a bug!

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

I am talking about what Kirill is talking about. ;-)
I just tested on beta 4 and the table looks okay and the output in the template works with this code

So, yeah, the bug seem to be fixed. 

I am still unsure about accessing the thumbs. 

  1. How do I access all regular images and thumbs of the same field at the same time in a template? For example to create a little gallery of the thumbs linking to the full-size images?
  2. How do I do the same in the field settings (“Listing/Display Custom Format”) where there is just $value and $formValue normally?
Link to comment
Share on other sites

  • 2 weeks later...
14 minutes ago, opentype said:

Upgraded my sites, but I still can’t retrieve the thumbnails. That Foreach loop from Daniel doesn’t work for me and I don’t even know what else I could try. 

True code:

<img src="/uploads/{$record->record_image_thumb}">

This bug is fixed, thanks for this, IPS Team!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...