Jump to:

23452 Posts in 18901 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » changing $Content through page.php

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
Go to End
Author Topic: 797 Views
  • Phill
    Community Member
    75 Posts

    changing $Content through page.php Link to this post


    I think im asking a real simple question here but how do i change the contents of the $Content template variable through the Page.php file.

    So i could run some rugular php on it like
    $Content = $Content . ' hello';

    Link i said i think im getting stuck on something real simple here


  • Fuzz10
    Community Member
    787 Posts

    Re: changing $Content through page.php Link to this post

    Yeah, you can overload the Content() method...

    function Content() {
       $sContent = $this->Content;

    ....do Some nast stuff to $sContent.

    return $sContent;


    good luck !

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.