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?
$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?
I solve this problem )
$p = Page::getByPath('/contacts');
$pbl = $p->getBlocks('Main');
$pbco = $pbl[0]->getInstance();
$arContent = $pbco->getContent();
$p = Page::getByPath('/contacts');
$pbl = $p->getBlocks('Main');
$pbco = $pbl[0]->getInstance();
$arContent = $pbco->getContent();
Another method is:
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.
$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.
http://tinyurl.com/ddrt6b