Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Change page template for User Defined Forms Module

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 2209 Views
  • ramshackle
    Avatar
    Community Member
    22 Posts

    Change page template for User Defined Forms Module Link to this post

    Hi there,

    Fairly new to SS and using the User Defined Forms Module - all working ok but I need to use a new template to display the page containing the form - it seems to default to using the "Page.ss" template and I can't see where to change this to my newly created template (you have to select "User Defined Form" from page type in the CSS whereas this is where you would normally select your new page template).

    Any help much appreciated.

    Cheers

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Change page template for User Defined Forms Module Link to this post

    All page types will use Page.ss if no template for that class name is defined. In this case if you made a UserDefinedForm.ss file (and flushed the cache) it would be using that file instead of Page.

  • gocreative
    Avatar
    Community Member
    17 Posts

    Re: Change page template for User Defined Forms Module Link to this post

    This makes sense and I've got it working, however what about in the case where I want to create a new page type? Say, a page which has two columns instead of the standard template with just one column.

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Change page template for User Defined Forms Module Link to this post

    One way would be to subclass UserDefinedForm say class DualColumnUserDefinedForm extends UserDefinedForm { then have a DualColumnUserDefinedForm.ss template and use that. Would mean you have a pagetype for purely layout which isn't great but it'll work

  • ramshackle
    Avatar
    Community Member
    22 Posts

    Re: Change page template for User Defined Forms Module Link to this post

    Thanks Willr,

    Quite obvious really! But didn't think about it.. Works great now.

    Oneilldesign - I just created UserDefinedForm.ss form the Page.ss template and added a new div within the 'Layout' div to create an extra column so this form page has a two column layout. Not sure if you mean you need the standard layout and an additional second
    template though - I guess that is what Willr is talking about.

    Cheers

  • gocreative
    Avatar
    Community Member
    17 Posts

    Re: Change page template for User Defined Forms Module Link to this post

    Thanks for the replies. I guess what I was really asking was how to create a new page template (purely for design/layout purposes). But you've more or less answered that question - I would just extend the Page class rather than the UserDefinedForm class.

    I'm new to SS (first install was yesterday) and just getting to know how it all comes together. Being primarily a designer rather than coder, I hope it's not too difficult to apply a different layout to each page on my site.

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