RenderWith & Namespace



If I extend a Page Controller in a module, for example SilverShop/Page/CheckoutPageController , in the extension php file, i have

public function checkoutMethod(){

But where shall i put the file? If i put it themes/mythemes/templates/Layout/ it can’t be found.

I also put it under
themes/mythemes/template/SilverShop/Page/Layout/ but no luck.

finally, i already follow the naming convention, do i need to run the renderwith method, can i just do

return array()

like SS3.0?

I had a similar problem with this (with the Sitemap2 module), albeit just overriding the existing template.

In my case, the correct location was


However, the thing that got me was that I copied the folder structure from the Vendor folder, which turned out to be slightly different to the Namespace used in the Sitemap2 files.


didn’t work but:


Also, I assume it is a typo in the post but in your description you said which surely should be


The typo was not the problem. the problem is SSviewer can’t find the file.

It can only find it if i put it under themes/mytheme/templates/

But SSViewer will render it without the themes/mytheme/templates/ and thus the page becomes headless

return array(), still works. The template goes into the same folder as your i am not shure if this allready helps.

In which namespace is your app.
Eg CompanyPage => Namespace app

I have my page models in an folder that is called Pages
eg HomePage => Name HomepageModel

So my templates will be in themes/themename/templates/CompanyPage/Pages/Layout/HomePage.

From what i understood actualy you can overwrite the template with out an extension. Just look where the silvershop has its templates. eg if i wanted to overwrite a template from elemental

It would be:

if you want to use renderWith you have to combind it with customise()->renderWith() than it will be rendered with page.

I think Greg_808 has has answered it but this is the cut down version I’ve just used:

return $this->customise($Data)->renderWith(array(‘MyTemplate’, ‘Page’));
== /templates/Layout/

return $this->customise($Data)->renderWith([‘Name/Space/MyTemplate’, ‘Page’]);
== /app/templates/Name/Space/Layout/

The extra ‘Page’ in my array is a fall back incase the first template isn’t found. It can come out. It is optional.