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, biapar, Willr, Ingo, swaiba, simon_w

ImageField with Link To Menu


Reply

650 Views

Avatar
VirtuallyUknown

17 October 2010 at 5:53pm Community Member, 4 Posts

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