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.

Archive /

Our old forums are still available as a read-only archive.

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

Three separate Images in the Home Page Banner -Sorry for the Cross Post


Go to End
Reply


12 Posts   3778 Views

Avatar
Willr

Forum Moderator, 5513 Posts

1 May 2008 at 10:15pm

ut it appears to me that you can't hard code images into the template using the <img> tag? is this true??

Of course you can. If you have saved the image in the current themes image folder you can use $ThemeDir as a shortcut even

Eg if your image is in themes/blackcandy/images/MyImage.gif

You can <img> it with

<img src="$ThemeDir/images/MyImage.gif" alt="My Awesome Image">.

Avatar
seagull

Community Member, 17 Posts

1 May 2008 at 10:23pm

right, I see now I was unclear about the path.

Thanks again.

Avatar
Martin Pales

Community Member, 19 Posts

4 May 2008 at 10:35pm

Hello guys,

I face a similar problem - I'd like to set up 3 image links on the homepage pointing to internal pages. However, instead of making 3 link fields in the db array and 3 image fields in the has_one array, I would like to only have 3 data object fields in the has_one array - each data object consisting of the image/link fields. Is this possible ? How will the getCMSFields method look like ?

Thank you for any help.

Avatar
Willr

Forum Moderator, 5513 Posts

5 May 2008 at 8:46am

One way is to use a complex table field - check out http://doc.silverstripe.com/doku.php?id=tutorial:5-dataobject-relationship-management.

Go to Top