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.

Archive /

Our old forums are still available as a read-only archive.

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

Get $Title from Page.php


Go to End
Reply


2 Posts   1726 Views

Avatar
tofola

Community Member, 1 Post

19 November 2008 at 2:27am

I am going to replace each $Title with an Image. The Image replacement work, but I can not find a way to pass the $Title variable from the .ss file to the actual function in Page.php.

ss template:

 $ifr($Test)  <-- This do not work!

Php:

 function ifr($text) {
        $text = DataObject::get('Title');
        doIfr($text);
    }

Avatar
Fuzz10

Community Member, 787 Posts

19 November 2008 at 2:45am

If you want to replace just the Titles , why not override the Title method in your class ?

e.g. :

function Title() {
return $this->doIfr($this->Title);
}

or something along those lines....