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.

General Questions /

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

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

Hasmanycomplextablefield problems / fast help appreciated


Reply


2 Posts   1761 Views

Avatar
lazerscience

Community Member, 16 Posts

24 March 2009 at 12:25am

Edited: 24/03/2009 5:52am

Hi,
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

$Image.SetSize(150,150)

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!
Thanks!

Thanks!

Avatar
Ricardona

Community Member, 26 Posts

18 June 2009 at 3:16pm

Edited: 18/06/2009 3:17pm

3. I'm using $Image.CMSThumbnail