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


Reply

2 Posts   1633 Views

Avatar
tofola

19 November 2008 at 2:27am Community Member, 1 Post

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

19 November 2008 at 2:45am Community Member, 787 Posts

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....