3393 Posts in 976 Topics by 852 members
|Go to End|
18 July 2011 at 10:05pm
I have set a custom field called $bgImage in the CMS. This field simply takes an image (img src="path/to/image").
it works fine in the front end when outputted simply as $bgImage, but I am unable to see any output when trying to use functions such as $bgImage.URL in my templates.
My PHP server has GD2. I am using WAMP so cannot set permissions for my tmp folder. Does anyone have any ideas of what im doing wrong?
18 July 2011 at 11:03pm
added a silverstripe-cache folder which is working but still no joy
19 July 2011 at 4:03am
OK i solved it.
Im very new to SilverStripe and made some simple mistakes.
In order to user methods such as .URL etc with images you have to declare a new database table first using either $has_one or $has_many. Then add a tab. Then you will have a new tab where you can upload images in your CMS and use them at will. I guess I will need to use an enumerated type for more than one image.
Im using this to allow people to update background images in the CMS so I can have text overlayed over an image rather than static pictures!
|Go to Top|