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.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

VirtualPage doesn't pick up custom fields

Go to End

2 Posts   1422 Views


Community Member, 148 Posts

6 March 2009 at 4:56pm

Edited: 06/03/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)


Community Member, 1 Post

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 $return;   

and then I put this into

<% control artistPages %>
<% end_control %>