17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 3370 Views |
-
Virtual Page to custom page

8 February 2008 at 11:32am
I have a page that has various additional fields set in addition to the main "Content" one. Also, it uses a different template.
How can I get my VirtualPage to use a different template from the standard Page.ss (shouldn't it grab the template from the target page anyway?) and use the additional fields?
Thanks
-
Re: Virtual Page to custom page

24 April 2008 at 10:34pm
had the same problem, couldn't find a function for this so here is my workaround:
say 'ProjectHolder' has 'VirtualPage' children pointing to some 'ProjectPage'. every 'ProjectPage' has a field 'Date', aside from the content, i want to show on my 'ProjectHolder' page:
in ProjectHolder_Controller:
function projectPages() {
$children = $this->Children();
$return = new DataObjectSet();
for ($i = 0; $i < $children->TotalItems(); $i++) {
$virtualPage = DataObject::get_by_id("VirtualPage", $children->Current()->ID);
$projectPage = DataObject::get_by_id("ProjectPage", $virtualPage->CopyContentFromID);
$return->push($projectPage);
$children->next();
}
return $return;
}in ProjectHolder.ss:
<% control projectPages %>
Project Date: $Date
Project Content: $Content
<% end_control %>hth
| 3370 Views | ||
|
Page:
1
|
Go to Top |


