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

Including UserForms on a template


Go to End


642 Views

Avatar
borriej

Community Member, 267 Posts

28 October 2011 at 11:44pm

Hello,

I have a reservation form which is on www.mysite.com/form1
Everything is very nicely styled with css, also the custom errors are set.

Now i have a pageType 'Diensten' where I want to include this form at the bottom of the page.

So i use:
Diensten.php

class Diensten_Controller extends Page_Controller {
	
   function ShowForm(){
		$get = DataObject::get_one('UserDefinedForm');
		return new UserDefinedForm_Controller($get); 
	}
   
}

Diensten.ss

            <% control ShowForm %>
            $Form
            <% end_control %>            

The form shows on all pages, BUT:
- the custom error messages are the default onces, not the onces i've set
- the styling of the error message is different

WHY? and HOW can i fix this?