Place page content on other page

Permalink
I try this in my block's controller.php

$p = Page::getByPath('/contacts');
$arContent = $p->getArea('Main');

and result:

Fatal error: Call to a member function getCollectionID() on a non-object in area.php on line 117

Where I wrong?

 
edsalt replied on at Permalink Reply
edsalt
...to a similar issue I had a while back. It might do the trick:

http://tinyurl.com/ddrt6b
velocityzen replied on at Permalink Reply
I solve this problem )

$p = Page::getByPath('/contacts');
$pbl = $p->getBlocks('Main');
$pbco = $pbl[0]->getInstance();
$arContent = $pbco->getContent();
ScottC replied on at Permalink Reply
ScottC
Another method is:

$ad = new Area('whatever');
$ac = Area::getById('cID like 1');
$add = Area::get($ac,'areaName');
$add->display($ac);


grabs an area from anywhere and loads it. I am not sure if local links will work, but with the new pretty url fixes for the content block it at least has a shot. I haven't investigated further.