I am sure this question is trivial but I can't find an answer (and I can't make it work either!) .
I would like to use a variable ($ProductUrl) to access the corresponding page with <% control page ($ProductUrl) %>
My code looks like this :
<% control AGProductInfo %>
<h2> $ProductUrl </h2>
<% control page($ProductUrl) %>
<div> $ProductIntro</div>
<% end_control %>
<% end_control %>
AGProductInfo is a DataObject containing the URL to a Product Page.
static $db = array(
'ProductUrl' => 'Text'
);
$ProductUrl is the URLSegment and is printed correctly in the <h2> line and, yes, the page exists.
However <% control page($ProductUrl) %> does not work ( I get a blank/empty page ).
I am obviously doing something wrong here. Is it possible to pass a variable to a page control? If not, what is the correct way
to directly access a page in a template ?
Any help would be highly appreciated.
Thanks