Get an Area from Parent Page doesn't work 100%

Permalink
Hi there,

maybe someone also discovered this behaviour and may help.
I created some special pages on my website where there child-pages - let's say on level 3 in the pagetree hirarchy - takes some data from its parent page.

It check it this way:
<?php 
if ($c->getCollectionTypeHandle() == "specialchild") $page = Page::getByID($c->getCollectionParentID());
else $page =  Page::getCurrentPage();
?>


that works fine when accessing data like
$page->getCollectionAttributeValue('specialvalue1')

and also with
<?php
$a = new Area('HeaderBanner');
$a->display($page);
?>


getting the Area "HeaderBanner" from the Parent Page I get the Content shown correctly, but without a modified block style design - if applied.

Any ideas?

thanks a lot

sk01

sk01
 
pvernaglia replied on at Permalink Reply
pvernaglia
I don't like to tell someone to try something I haven't tried myself first, but I would look at this:

$a->setCustomTemplate($btHandle, $template)


http://www.concrete5.org/documentation/developers/pages/areas...
JohntheFish replied on at Permalink Reply
JohntheFish
You could just put a Parent Area block on the subpages and that will do it all for you.
http://www.concrete5.org/marketplace/addons/parent-area/...
aghouseh replied on at Permalink Reply
aghouseh
I just had the same issue, because within the view, the header items for a given area's blocks have already been aggregated. It's too late to insert them into the head, so you would have to do something different to get the relevant block assets to load as well.