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.

Archive /

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

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

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


Go to End


12 Posts   4466 Views

Avatar
Willr

Forum Moderator, 5523 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, 5523 Posts

5 May 2008 at 8:46am

Go to Top