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:

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

[SOLVED] Action function Layout is rendering without Page template

Go to End

3 Posts   2727 Views


Community Member, 25 Posts

7 March 2012 at 5:55am

I have done a work around for the following problem in the past but I think I need to find a proper solution now.

My problem is this

1. I have a page type of, e.g. ParentPage
2. I have other page types e.g. ChildPage1 & ChildPage2, which extend ParentPage

I have put an action function in the ParentPage that I want all child page types to access, e.g. function addnote() as shown here: -

function addnote()
	$data = array(...);
	return $this->customise($data)->renderWith("ParentPage_addnote", "ParentPage");

I have a main template called and in the Layout folder I have a layout template called

Now I have setup a few pages of the ChildPage1 type and go to it by the function works and the layout is rendered, but it is rendered without the page template shell

Where am I going wrong?


Community Member, 25 Posts

7 March 2012 at 11:50pm

OK, found the answer: -

 return $this->customise($data)->renderWith("ParentPage_addnote", "ParentPage"); 

Needs to be: -

 return $this->customise($data)->renderWith(array("ParentPage_addnote", "ParentPage")); 


Community Member, 3 Posts

22 October 2014 at 3:20pm

This is ridiculous and makes little sense but yes it works. It would be nice if it was a little more explicit.