Jump to:

3447 Posts in 1032 Topics by 872 members

Template Questions

SilverStripe Forums » Template Questions » renderWith and layout

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

Page: 1
Go to End
Author Topic: 5616 Views
  • Jean-Phi
    Avatar
    Community Member
    12 Posts

    renderWith and layout Link to this post

    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?

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: renderWith and layout Link to this post

    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)

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: renderWith and layout Link to this post

    Sure you have flushed? (?flush=1)

    On the other hand try

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

    5616 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.