Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Render Custom template

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1 2
Go to End
Author Topic: 1198 Views
  • RD
    Avatar
    Community Member
    5 Posts

    Re: Render Custom template Link to this post

    hmmm ContentController is the place to add the code, I will try it out. thanks!!

  • camfindlay
    Avatar
    Forum Moderator
    148 Posts

    Re: Render Custom template Link to this post

    Ideally you don't want to hack the core...

    as I say, if you are trying to add this functionality to all Page Controllers then you could define it in the Page.php in the Page_Controller.
    My example is is more if you are using a custom controller and routing (i.e. not a Page on the Site Tree).

    Page_Controller inherits from ContentController.

  • camfindlay
    Avatar
    Forum Moderator
    148 Posts

    Re: Render Custom template Link to this post

    Let me know how you got on RD, if if this helped to solve your problem can you post some information about what you ended up doing to make this thread useful for others. thanks.

  • Mo
    Avatar
    Community Member
    508 Posts

    Re: Render Custom template Link to this post

    Hi both,

    Wouldn't it make more sense to add the code that sets the template name in an extension of controller (or content controller).

    That way the template will be available globally?

    Cheers,

    Mo

    1198 Views
Page: 1 2
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.