7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » VirtualPage?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 363 Views |
-
VirtualPage?

22 November 2010 at 6:41pm
Hi everyone,
I'm sure this isn't the first time this has been asked, but I haven't been able to locate the answer.
If I create a VirtualPage link to a page that uses DOM, the DOM objects from the 'real' page aren't inherited.. Is that expected behavior? I found a few hacks for individual cases, but I'm curious if either I'm doing something incorrectly or there's a known way to create this dependence.
I've already built the back-end nav structure, so would be nice if there were!
Thanks in advance, for your time!
Wilson -
Re: VirtualPage?

24 November 2010 at 3:07pm
Solved, thanks to Zauberfisch.
class VirtualPageWithImages extends VirtualPage {
static $icon = array("cms/images/treeicons/page-shortcut-gold","file");public function getCMSFields() {
$f = parent::getCMSFields();
$f->removeByName('Photos');
return $f;
}
}class VirtualPageWithImages_Controller extends VirtualPage_Controller {
public function Photos() {
return DataObject::get('Photo', 'PageID = '.$this->CopyContentFrom()->ID);
}}
| 363 Views | ||
|
Page:
1
|
Go to Top |

