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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Customising Labels - ImageGallery: SOLVED


Go to End


2 Posts   988 Views

Avatar
pinkp

Community Member, 182 Posts

13 April 2010 at 2:13am

Edited: 13/04/2010 8:41am

What is the best way to change the labels of the ImageGallery. I need to customise it like so:

ImageGalleryAlbum.php

public function getCMSFields_forPopup()
	{
		return new FieldSet(
			new TextField('AlbumName', _t('ImageGalleryAlbum.ALBUMTITLE','Artist Name')),
			new TextareaField('Description', _t('ImageGalleryAlbum.DESCRIPTION','Artist Statement')),
			new ImageField('CoverImage',_t('ImageGalleryAlbum.COVERIMAGE','Artist Main Image'))
		);
	}

And also change all "album' references to "artist" the above does not seem to have any effect?

Thanks

---------------
EDIT

public function getCMSFields_forPopup()
	{
		return new FieldSet(
			new TextField('AlbumName', _t('ImageGalleryAlbum.ARTISTNAME','Artist Name')),
			new TextareaField('Description', _t('ImageGalleryAlbum.ARTISTSTATEMENT','Artist Statement')),
			new ImageField('CoverImage',_t('ImageGalleryAlbum.ARTISTMAINIMAGE','Artist Main Image'))
		);
	}

Avatar
UncleCheese

Forum Moderator, 4102 Posts

15 April 2010 at 1:46am

I'm pretty sure the cleanest way to do this would have been to override the lang file.

$lang[your_Locale]['ImageGalleryAlbum']['ALBUMTITLE'] = "My Label";