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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

KickAssets has_one Image question


Go to End


2 Posts   1209 Views

Avatar
Hello_electro

Community Member, 80 Posts

18 December 2011 at 12:07pm

Hi

This question is probably for UncleCheese

I am using your KickAssets plugin which works great. But I am curious why it is not affecting the standard upload for a basic $has_one array.


static $has_one = array(
        'FBHolderImage' => 'Image'
    );

Should this be using the new kickassets interface as well?

Avatar
Hello_electro

Community Member, 80 Posts

18 December 2011 at 12:10pm

Nevermind!

Solved below: Use FileAttachmentField


 static $has_one = array(
	'FBHolderImageNew' => 'File'
    );
	function getCMSFields() {
        $fields = parent::getCMSFields();
	$fields->addFieldToTab("Root.Content.FaceBookHolder", new FileAttachmentField('FBHolderImageNew', null, null, null, null, "FaceBookImages"));
         
        return $fields;
    }