⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Image thumbnail in LIST PAGE



hunterbit
  • profile picture
  • Member

Posted 14 November 2011 - 01:27 AM

[color=#333333][font=arial, sans-serif][size=4]Hello to all forum[/size][/font][/color]
[color=#333333][font=arial, sans-serif][size=4]on the "[/size][/font][/color][color=#333333][font=arial, sans-serif][size=4]LIST PAGE"[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]it is[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]possible to[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]display a[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]thumbnail[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]of an image[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]instead of its[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]name?[/size][/font][/color]
[color=#333333][font=arial, sans-serif][size=4]if yes [/size][/font][/color][color=#333333][font=arial, sans-serif][size=4]like[/size][/font][/color] i can [color=#333333][font=arial, sans-serif][size=4]do?[/size][/font][/color]

[color=#333333][font=arial, sans-serif][size=4]Thank you.[/size][/font][/color]

aem34
  • profile picture
  • Member

Posted 19 November 2011 - 22:12 PM

[quote name='hunterbit' timestamp='1321234028' post='41']
[color=#333333][font=arial, sans-serif][size=4]Hello to all forum[/size][/font][/color]
[color=#333333][font=arial, sans-serif][size=4]on the "[/size][/font][/color][color=#333333][font=arial, sans-serif][size=4]LIST PAGE"[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]it is[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]possible to[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]display a[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]thumbnail[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]of an image[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]instead of its[/size][/font][/color] [color=#333333][font=arial, sans-serif][size=4]name?[/size][/font][/color]
[color=#333333][font=arial, sans-serif][size=4]if yes [/size][/font][/color][color=#333333][font=arial, sans-serif][size=4]like[/size][/font][/color] i can [color=#333333][font=arial, sans-serif][size=4]do?[/size][/font][/color]

[color=#333333][font=arial, sans-serif][size=4]Thank you.[/size][/font][/color]
[/quote]

+1 !

please could it be possible to have a callback for upload file type columns ?

and the same for add/update pages, for example so that we could create or display thumbnails
besides the upload file form ?

fleep
  • profile picture
  • Member

Posted 25 March 2012 - 09:44 AM

+1 for the thumbnail option

xxaxxo
  • profile picture
  • Member

Posted 26 March 2012 - 06:02 AM

You can do this (for the list option) with a callback
here is an example for you:


$crud->callback_column('news_images', array($this, '_transformIMG'));



function _transformIMG($value, $row) {
$img = "<div class='thumbnail span1'><img src='" . base_url('img/news_images') . "/" . $value . "' /></div>";
return($img);
}



I haven't tried to make the upload form show thumbnail - that is just for the column to display a thumb instead of the name of the image

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 26 March 2012 - 06:16 AM

And to create the thumbnail you can use the callback_after_upload . I have documentation of how to do it with the image_moo library at: http://www.grocerycrud.com/documentation/options_functions/callback_after_upload

threestatedrive
  • profile picture
  • Member

Posted 18 April 2012 - 17:43 PM

if i used a callback_edit_field to display the image on the edit page, how do i maintain the delete link?

rhouzvecxs
  • profile picture
  • Member

Posted 06 June 2012 - 12:11 PM


$crud->callback_column('news_images', array($this, '_transformIMG'));



function _transformIMG($value, $row) {
$img = "<div class='thumbnail span1'><img src='" . base_url('img/news_images') . "/" . $value . "' /></div>";
return($img);
}


hi grocery CRUD Expert
[color=#666600]This is great for table page only. How to view the image in edit and add page do you any idea?[/color]

jrowe
  • profile picture
  • Member

Posted 18 June 2012 - 13:51 PM

Just a shot in the dark as I am a noober but, couldn't you use the callback_field function for the edit page? Most likey the add page would have to be the after_upload callback to add the thumbnail there.

xsigno
  • profile picture
  • Member

Posted 09 August 2012 - 15:56 PM

I have same problem. File fields need a lot of code (due to ajax funcionality) to be managed, I tried some reverse engeneering but i failed. Any Help?


[quote name='threestatedrive' timestamp='1334771019' post='1306']
if i used a callback_edit_field to display the image on the edit page, how do i maintain the delete link?
[/quote]

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 12 August 2012 - 22:49 PM

I added this functionality at the new version 1.3 . The release is not ready yet but whoever is interested can try the trunk version at: https://github.com/s.../zipball/master