Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Hasmanycomplextablefield problems / fast help appreciated

Go to End

2 Posts   1964 Views


Community Member, 16 Posts

24 March 2009 at 12:25am

Edited: 24/03/2009 5:52am

I'm new to silverstripe and right now working on my first project which should be done in a few days.
I just encountered some problems with the Hasmanycomplexfield...

1. I have multiple pictures assigned to a project. If I upload a picture it's displayed in the hasmany...table, but I cant change it in size!
The code

$imagesfield->setFieldFormatting(array('Image' => '$Image.SetWidth(100)'));
which appeared logical to me, doesnt work (just shows .SetWidth(100) on the table cell!

2. Is there a fast way to change the bahaviour of the image uploader in the popup so that you dont have to save before adding the file (i wouldnt need any preveiw there)?

3. In the template I can't get Image Resizing working.. I'm trying

but I'm just getting the error message [Warning] Missing argument 1 for Image::SetSize(). Seems to me that there is a problem handling more than one argument in the template? I was not able to find any descent documentation about it, but is it also the right syntax to just seperate the twovalues via comma?

I'd appreciate any help, since I should finish this site (which is my first SS project) soon... Learned really a lot already and I'm quite impressed by SS!



Community Member, 26 Posts

18 June 2009 at 3:16pm

Edited: 18/06/2009 3:17pm

3. I'm using $Image.CMSThumbnail