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

Controlling a Class on a specific 'Branch'


Reply

11 Posts   1344 Views

Avatar
MagicUK

19 August 2011 at 6:57am Community Member, 60 Posts

Whoops we both replied at the same time there!

Avatar
martimiz

19 August 2011 at 7:08am Forum Moderator, 1091 Posts

The odds... :-) Anyway, I don't know about the getField thing - never had to use them, and it's been a while since I used the UserForms. But when located at the current page controller, at least the query might look something like this:

function ShowForm(){
$get = DataObject::get_one('UserDefinedForm', "ParentID = '{$this->ParentID}' AND Title = 'BrochureForm'");
return new UserDefinedForm_Controller($get);
}

Avatar
MagicUK

19 August 2011 at 7:16am Community Member, 60 Posts

Mate. I could honestly kiss you. haha. That worked! My troubles are solved! (At least until tomorrow)

Thanks!