This topic is locked

Image size

9/29/2006 3:37:55 PM
PHPRunner General questions
M
mmponline author

V3.1
When I set the Image size on the List Page -Visual Editor ( Properties - File based Image) the setting is changed automatically on the View page as well. - and Vise Versa.
This is not good, as I want the specific field to display thumbnail size on the list page, and large on the view page.
Is this a bug? How do I fix this? Need to do a demo on Monday.
The edit page has a picture view built in for ducument upload. This one has no option to set the size on the properties, so the picture always view at normal size. (Would be nice to have it displaying thumb size.

Sergey Kornilov admin 9/29/2006

Stephan,
"View as" property of the field is shared between View/List/Print pages so you don't have to set it on every page.
If you like to have different size of file-based image you can use a "Custom expression" type.

$value = "<img width=50 height=50 src='" . $value . "'>";
M
mmponline author 9/30/2006

Stephan,

"View as" property of the field is shared between View/List/Print pages so you don't have to set it on every page.
If you like to have different size of file-based image you can use a "Custom expression" type.

$value = "<img width=50 height=50 src='" . $value . "'>";


Im struggling to get this working. Where and how must this code be added.
Further - Can this be used to resize the Add / edit pages thumbnail s as well?

Alexey admin 10/2/2006

Stephan,
to display the image with normal size on the View page and small on List set the image width and height in Visual Editor as for the List page.

Build the pages and open ..._view.php file with a text editor.

Find this snippet there and delete bolded lines:

if(CheckImageExtension($data["FieldName"]))

{

$value="<img";

$value.=" width=...";

$value.=" height=...";
$value.=" border=0";

$value.=" src=\"".htmlspecialchars(AddLinkPrefix("FieldName",$data["FieldName"]))."\">";

}


To change the width and height of an image on Edit page find this line in generated include\commonfunctions.php file:

$ret='<img src="'.AddLinkPrefix($field,$ret).'" border=0>';

and modify it this way:

$ret='<img width=200 height=200 src="'.AddLinkPrefix($field,$ret).'" border=0>';