5121 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1308 Views |
-
creating new imagefield for content

2 November 2010 at 10:09am
Hi,
I would like to know is there any possible way to create additional imagefield for content, because my website will have different photo for each page. Please kindly have a look at my testing website http://www.cambodia-wildlife-adventures.org/ you will see each page have the same photo display.
Bunheng
-
Re: creating new imagefield for content

2 November 2010 at 10:19am
All covered in here...
http://doc.silverstripe.org/tutorial:2-extending-a-basic-site
but instead of static $db = array('Date'... you want $has_one = array('MyImage' => 'Image');
and instead of TextField or DateField you want... ImageField...
-
Re: creating new imagefield for content

2 November 2010 at 11:44pm
Hi,
Thanks for your replies, now it works fine on my website, additional thing is, is it possible that we can write any condition to check if there is no image on that imagefield then we need to display other thing?
Thanks for your help.
Bunheng
-
Re: creating new imagefield for content

3 November 2010 at 1:06am
sure... somethign like...
<% if MyImageID != 0 %>
$MyImage
<% else %>
No Image
<% end_if %> -
Re: creating new imagefield for content

3 November 2010 at 4:06pm
Thanks, I work now, with following code:
<% if MyImageID %>
$MyImage
<% else %>
No Image
<% end_if %>Thanks
| 1308 Views | ||
|
Page:
1
|
Go to Top |

