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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

ImageField with Link To Menu

Go to End



Community Member, 4 Posts

17 October 2010 at 5:53pm

I was wondering if there is a way to have a ImageField with a Link To menu (radio list) like in the HTML editor for links? I want to have my client be able to link to pages in the site or external content.

I found this in the forum to link to a page...

'MainImage' => 'Image',
'MainImageImageLink' => 'SiteTree',

$fields->addFieldToTab("Root.Content.Images", new FieldGroup(
new TreeDropdownField("MainImageImageLinkID", "<b>Main Image Block</b><br />Select the page to link to and then choose the image to display", "SiteTree"),
new ImageField('MainImageImage','')

Can I add anything to get the Link to menu with the ImageField or can I only link the image to pages in the site?

Thanks for any help