質問

Is there a way to adjust the size of gorcery CRUD's list thumbnails?

The way it is now it's just silly big, and breaks the table flow. If possible, it would be nice to have a PHP solution or grocery CRUD setting for this; if not - a CSS rule would be ok, I guess.

役に立ちましたか?

解決

Same issue I came across, I'm sure it's a quick-and-dirty solution but it worked for me.

  • Open your application/library/Grocery_CRUD.php
  • Download timthumb from here
  • Place timthumb.php in Root directory (in same directory level cache folder should be there)
  • Find function change_list_value
  • Find around line number 333 in Grocery_CRUD.php

    $file_url_anchor .= 'class="image-thumbnail">';

Replace with... following

 $file_url_anchor .= ' class="image-thumbnail"><img src="' . base_url('timthumb.php') . '?src=' . $file_url . '&w=100&h=100&zc=3' .'" height="50px">';
  • Again Find function get_upload_file_input
  • Find around line number 2545 in Grocery_CRUD.php

    $input .= $is_image ? " $image_class'>" : "' target='_blank'>$value";

Replace with following

$input .= $is_image ? " $image_class'><img src='".base_url('timthumb.php') . '?src=' . $file_url . '&w=100&h=100&zc=3'."' height='50px'>" : "' target='_blank'>$value";

Hope this would help you to get rid of ugly size in your list as well as add/edit forms

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top