Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

1598 Posts in 399 Topics by 403 members

Template Questions

SilverStripe Forums » Template Questions » renderWith and layout

Page: 1
Go to End
Author Topic: renderWith and layout 836 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
    608 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
    499 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'));

    836 Views
Page: 1
Go to Top

Currently Online: There is nobody online.

Welcome to our latest member: GreenWork

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

Comments on this website? Please give feedback.