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.

General Questions

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

multiple DataExtensions on one class?


3 Posts   356 Views


11 March 2013 at 11:18am Community Member, 233 Posts

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?


11 March 2013 at 10:41pm Forum Moderator, 5511 Posts

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.


14 March 2013 at 4:50pm Community Member, 233 Posts

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

public function contentcontrollerInit($controller) { }