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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

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

Need help with User Forms 0.3.0 module

Go to End

3 Posts   1046 Views


Community Member, 130 Posts

6 October 2010 at 8:40am

Edited: 06/10/2010 9:01am

I want to give my CMS admins the ability to create a custom form on a few page templates. The pages are not "form pages" per se, but they do allow a form to be included on them. So I have set up a many-many relationship between the extended form class and the pages that I want the form to appear on. A user creates a form in the CMS and then via the ManyManyComplexTableField can assign the form to a template with the many-many relationship.

My problem is that everything seems to be working fine except when the template prints the form, it literally prints "$RightColumnForm" (the name of my extended class) instead of the actual form.

I extended /userforms/code/UserdefinedForm.php class and changed the default content template to my new content template:


class RightColumnForm extends UserDefinedForm {
	// ...
	static $defaults = array (
		'ShowInMenus' => false
		,'ShowInSearch' => false
		,'Content' => '$RightColumnForm'
	// ...

Created my form template:


Included that template in my page:

<% include RightColumnForm %>

Screenshot of the problem attached.



Community Member, 130 Posts

6 October 2010 at 11:51am

To clarify some things...

SS 2.4.0

The many-many relationship between the page class and the extended form class is working. The conditional statement in the file is showing the title of the correct form that is associated with that page. It's the form itself that's not showing up.

If I remove the $RightColumnForm from the CMS, still nothing shows up.

If I hit the form url directly, instead of the url of the page it is included on, the form shows correctly.

Thanks for any assistance.


Community Member, 130 Posts

7 October 2010 at 12:37pm

Sorry to continue this one-man discussion, but can anyone confirm that this should or shouldn't work? I feel like I'm just banging my head against this wall.

Since the $MenuTitle.XML of the form displays, I know the many-many relationship between the forms and the pages are working; but not the actual form.

Can userforms not be extended or do they just not play nice in a many-many relationship?

This is my code:

<% if RightColumnForms %>
	<% control RightColumnForms %>
		<h3 class="accHeader $LinkingMode">
		<div class="accCell">
	<% end_control %>
<% end_if %>