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.

Template Questions /

renderWith and layout


Reply


3 Posts   5649 Views

Avatar
Jean-Phi

Community Member, 12 Posts

28 January 2009 at 12:19am

Edited: 28/01/2009 12:20am

Hi,

I have a file like this :

templates/Page.ss :

<p>$Layout</p>

and another :

templates/layout/Pages.ss

toto

In a controller I have an action that return :

$this->renderWith('Page');

in the response I have 'toto' instead of :

<p>toto</p>

why?

Avatar
Hamish

Community Member, 712 Posts

28 January 2009 at 8:48am

That's odd. Try adding "?showtemplate=1" to the end of the URL - that will tell you what templates it's hitting.

(btw, does your layout dir have a capital L? Don't know if it matters, but mine always have L instead if l)

Avatar
dio5

Community Member, 501 Posts

28 January 2009 at 9:13am

Edited: 28/01/2009 9:14am

Sure you have flushed? (?flush=1)

On the other hand try

$this->renderWith(array('Page', 'Page'));