5102 Posts in 1520 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 923 Views |
-
VirtualPage doesn't pick up custom fields

6 March 2009 at 4:56pm Last edited: 6 March 2009 5:01pm
I have a few double-up pages round the site I am working on so thought I had found the answer with the VirtualPage type (keeps the nav & breadcrumb etc intact)....but, I have quite a few different page types in the site and VirtualPage only picks up content and not the custom fields...
Has anyone found a workaround for this. ??
the proper page
the virtual page (video content not picked up) -
Re: VirtualPage doesn't pick up custom fields

15 April 2009 at 1:17am
Here's what I'm doing. Seems to work for me.
I have an Event page type, which can have any number of Artist pages as children, but I'm using virtual pages that point to Artist pages rather than actual Artist pages.
So I put this function into EventPage_Controller.
function artistPages() {
$children = $this->Children();
$return = new DataObjectSet();
foreach ($children as $key)
{
$virtualPage = DataObject::get_by_id('VirtualPage', $key->ID);
$artistPage = DataObject::get_by_id('ArtistPage', $virtualPage->CopyContentFromID);
$return->push($artistPage);
}
return $return;
}and then I put this into EventPage.ss
<% control artistPages %>
$ArtistName
$ArtistDescription
<% end_control %>
| 923 Views | ||
|
Page:
1
|
Go to Top |

