Jump to:

10848 Posts in 2516 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Image_Gallery - Renaming Tabs

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1094 Views
  • codepattern
    Avatar
    Community Member
    6 Posts

    Image_Gallery - Renaming Tabs Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image_Gallery - Renaming Tabs Link to this post

    You're doing this in a subclass?

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

  • codepattern
    Avatar
    Community Member
    6 Posts

    Re: Image_Gallery - Renaming Tabs Link to this post

    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?

  • codepattern
    Avatar
    Community Member
    6 Posts

    Re: Image_Gallery - Renaming Tabs Link to this post

    Is "dataobjectdecorator" the right way to this?

    1094 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.