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.

General Questions /

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

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

multiple DataExtensions on one class?


Go to End


3 Posts   882 Views

Avatar
JonShutt

Community Member, 244 Posts

11 March 2013 at 11:18am

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?

Avatar
Willr

Forum Moderator, 5523 Posts

11 March 2013 at 10:41pm

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.

Avatar
JonShutt

Community Member, 244 Posts

14 March 2013 at 4:50pm

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

public function contentcontrollerInit($controller) { }