Jump to:

10993 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Can't add pages after installing module subsites

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 1963 Views
  • dacar
    Community Member
    168 Posts

    Re: Can't add pages after installing module subsites Link to this post

    hmmm, after changing $subsite = $this->owner->Subsite(); to $subsite = Subsite::currentSubsite(); it is working now.

       function updateCMSFields(&$fields) {
          if($this->owner->MasterPageID) $fields->insertFirst(new HeaderField('This page\'s content is copied from a master page: ' . $this->owner->MasterPage()->Title, 2));
          // replace readonly link prefix
          //$subsite = $this->owner->Subsite();
          $subsite = Subsite::currentSubsite();
          if($subsite && $subsite->ID) {
             $baseUrl = 'http://' . $subsite->domain() . '/';
                new LabelField('BaseUrlLabel',$baseUrl),

Page: 1 2
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.