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.

All other Modules /

Discuss all other Modules here.

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

Image_Gallery - Renaming Tabs


Go to End


4 Posts   1968 Views

Avatar
codepattern

Community Member, 11 Posts

19 September 2010 at 1:05pm

My first post - hooray!! This forum community has helped me over the years, but this one has got me beat.

I am trying to rename the tabs in the Image Gallery module without changing the core code. I have tried of few different methods, the last being: $fields->fieldByName('Root.Content.Albums')->setTitle('Potfolio'). Is it possible to rename the tabs?

Thanks in advance

Avatar
UncleCheese

Forum Moderator, 4102 Posts

20 September 2010 at 2:33am

You're doing this in a subclass?

---------------
Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com

Avatar
codepattern

Community Member, 11 Posts

20 September 2010 at 4:43am

Thanks for the reply ...

Yes, I believe so. I subclassed ImageGalleryPage as shown below to add several new fields to the Album class.

class ClientImageGalleryPage extends ImageGalleryPage {

protected $albumClass = "ClientImageGalleryAlbum";
}

then tried to override a few variables either do a

public function getCMSFields($cms) {

$albums = _t('ImageGalleryPage.ALBUMS','Portfolios');

$f = parent::getCMSFields($cms);
$f->addFieldToTab("Root.Content.$configuration", new HeaderField($title = _t('ImageGalleryPage.ALBUMCOVERIMAGES','Portforlio cover images'), $headingLevel = "6"));

and a few ..
$manager->setAddTitle(_t('ImageGalleryPage.ALBUM','an Portfolio'));
$manager->setSingleTitle(_t('ImageGalleryPage.ALBUM','Portfolio'));
...

or

...

public function getCMSFields($cms) {

$f = parent::getCMSFields($cms);
$f->fieldByName('Root.Content.Albums')->setTitle('Potfolio').

...

That did not work either. Is there's a better way?

Avatar
codepattern

Community Member, 11 Posts

21 September 2010 at 1:53am

Is "dataobjectdecorator" the right way to this?