Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » multiple DataExtensions on one class?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 327 Views
  • Futureweb
    Avatar
    Community Member
    232 Posts

    multiple DataExtensions on one class? Link to this post

    Hi, I've a script exteding the main page class

    class CustomExtention extends DataExtension { }
    +
    Object::add_extension('Page', 'CustomExtention ');

    All good, however, on a site where there is another module already extending the 'Page' class, this 2nd extension doesn't seem to be picked up

    Is it only possible to have one dataextension on any one class? If that's true, is there any kind of work around?

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: multiple DataExtensions on one class? Link to this post

    You can have as many extensions on a class as you want. Make sure you have an add_extension() call for each of the extensions. You'll need to flush=1 when you add a new class to get it added to the manifest.

  • Futureweb
    Avatar
    Community Member
    232 Posts

    Re: multiple DataExtensions on one class? Link to this post

    cool, seems to work now using to add some content into the header...

    public function contentcontrollerInit($controller) { }

    327 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.