Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » UserForms as an extension (using DataObjectDecorator)

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1097 Views
  • ohm
    Avatar
    Community Member
    3 Posts

    UserForms as an extension (using DataObjectDecorator) Link to this post

    the suggestion in the title might not be the best solution though... here's what I'm trying to do:

    I want to add a userform to an already existing pagetype, that already sits comfortably in my class hierarchy, so inheriting from UserDefinedForm is not ideal.

    Any other way to put a user defined form on that page? Using DataObjectDecorator would mean rewriting UserDefinedForm or wrapping it in a DataObjectDecorator somehow...

    thanks

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: UserForms as an extension (using DataObjectDecorator) Link to this post

    Interesting thought, hadn't thought of making a decorator. UserDefinedForm.php does contain alot of custom code so not sure if you're going to run into issues round the form submission process but to be honest I think most of it should work fine as a decorator (Haven't tested decorators with forms).

    Give it a go rewriting it as a decorator and let me know how far you get. Might be interested in seeing what issues you have and if they can resolved and redo the module core for it because you're quite correct - it would make the page type alot more flexible.

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