Hello,
I have defined a custom function that is called by the Content function of the Page_Controller. The function replaces a string with a customer image throughout my site.
This render works on any page content. However, when I attempt to call the function from within by sidebar that is included in a page via the include statement it does not render. It just shows the text. So what am I doing wrong?
Here is some code.
class Page_Controller extends ContentController {
.
.
function Content() {
$thereturn=str_replace('$PayPalFormsubdomain', $this->PayPalFormsubdomain(), $this->Content);
return $thereturn ;
}
function PayPalFormsubdomain() { return 'some text'; }
}
In my Page.ss
<% include SideNav %>
In SideNav.ss
<% control ALLChildren %>
$Content
<% end_control %>
The result displays:
$PayPalFormsubdomain
Instead of: some text