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: -
$data = array(...);
return $this->customise($data)->renderWith("ParentPage_addnote", "ParentPage");
I have a main template called ParentPage.ss and in the Layout folder I have a layout template called ParentPage_addnote.ss
Now I have setup a few pages of the ChildPage1 type and go to it by domain.com/childpage/addnote the function works and the ParentPage_addnote.ss layout is rendered, but it is rendered without the page template shell ParentPage.ss
Where am I going wrong?