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.

Customising the CMS /

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

Create menu item (type gallery)


Go to End


3 Posts   863 Views

Avatar
MrFail

Community Member, 5 Posts

18 June 2015 at 8:44pm

Hi,
How to create image gallery in admin panel in silverstripe 3.1

Avatar
Devlin

Community Member, 344 Posts

19 June 2015 at 9:27pm

I'm pretty sure there are multiple modules for this. Basically it's something like this:

class Page extends SiteTree {
	private static $many_many = array(
		'Images' => 'Image',
	);
	public function getCMSFields() {
		$fields = parent::getCMSFields();
		$fields->addFieldToTab('Root.Images', UploadField::create('Images')	);
		return $fields;
	}
}

<% loop $Images %>
$Tag
<% end_loop %>

http://www.silverstripe.org/learn/lessons/
http://docs.silverstripe.org/en/3.1/tutorials/

Avatar
MrFail

Community Member, 5 Posts

19 June 2015 at 10:13pm

Hi Delvin,
Thank you .I tried this solution and it goes