Jump to:

22977 Posts in 11742 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » Controlling a Class on a specific 'Branch'

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 2
Go to End
Author Topic: 1160 Views
  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Controlling a Class on a specific 'Branch' Link to this post

    Whoops we both replied at the same time there!

  • martimiz
    Avatar
    Forum Moderator
    1037 Posts

    Re: Controlling a Class on a specific 'Branch' Link to this post

    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);
    }

  • MagicUK
    Avatar
    Community Member
    60 Posts

    Re: Controlling a Class on a specific 'Branch' Link to this post

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

    Thanks!

    1160 Views
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.