Changing Page Alias Properties Based on Alias's Parent vs Original's Parent

Hi all. Hoping someone has an idea for this.
I have a site that is going to highlight 2 major events: a Winter Event and a Summer Event. Pages specific to each event will live under their respective folders in the sitemap and are displayed differently using CSS based on a Page Attribute set on the page’s parent folder… nav bar for Winter is blue, summer, green.
But there are pages that are common across the two events. My first thought was to create a Common folder in the site map, keep everything there and add page aliases under each event so the edits would only need to be made once. But when looking for the parent of the alias, I get the Common folder and not Winter or Summer.
Any ideas on how to solve this?
Is there a way to add a page attribute to a page alias?
Thanks in advance.
C

One alternative would be to create a page under winter and summer, then put the common content in a stack.

A variation of this would be to use my Universal Content Puller to pull an area of the summer page into the equivalent winter page (or vice-versa) Universal Content Puller - Concrete CMS

Thanks for the reply. Stacks dont really work because my client LOVES the custom area styles and layouts and such. Would your Package port that over?

I tried a quick solution by using

$a = new Area($blockAreaHandle);
$a->display($sourcePage);

thinking that would just copy everything over but the custom styles arent included.

I tried to bring in some of the code from Concrete\Core\Page\Collection so I could inject the $sourcePage like…
outputCustomStyleHeaderItems()
and
getCollectionID()

and in there I changed…
return $this->cID ? (int) $this->cID : null;
to
return $this->internalSourceCID ? (int) $this->internalSourceCID : null;

and got to a point where I seemed to make progress but then hit an error…

Call to undefined method Application\Block\ContentGrabber\Controller::getCollectionThemeObject()

I have the…
use Concrete\Core\Page\Page;
in place but it doesnt seemed to find that method.

Any ideas what I am doing wrong?

There are a lot of tricks involved in pulling an area into another page. UCP currently pulls the area and anything that contributes HTML to the area such as block templates, layouts, stacks, containers.

It also pulls in block .css and .js and any further css and js that is loaded through the block as header/footer items.

It doesn’t currently pull in block/area design styles, but that is a good idea, so I am going to add an option for that.

v9.3.12 of UCP now includes an option to include design when pulling page areas.

That. Is. Awesome. That’s exactly what I was trying to accomplish. And I see my feeble attempt had. along way to go :slight_smile:

Thanks for the help and the great block.

C

1 Like