Programmatically copy and paste blocks between pages

Permalink
Hello all

I'm thinking of a clever way of amalgamating blocks from several sub-pages into a kind of parent 'hub' page, to display a kind of summary overview of the child pages.

One mechanism in c5's architecture which would permit for a centralised 'import' of blocks in this way is the copy and paste facility. It would be quite time-consuming though to do this manually if there are, say, 5 child pages each with 5-10 blocks.

I wondered if it's possible to automate this, so that a page of type 'parent' automatically copies and pastes all the blocks from its children into its Main Area.

Although Stacks might make some sense here, it wouldn't allow for a bespoke layout of the blocks on the parent page in the way that copying and pasting does.

Just a thought. I might dig into Events to see if I can come up with anything.

melat0nin
 
JohntheFish replied on at Permalink Reply
JohntheFish
Rather than copy/paste, you can just cross reference, as done in the Global Areas block.
http://www.concrete5.org/marketplace/addons/global-areas/...

Another approach would be Page List Teasers
http://www.concrete5.org/marketplace/addons/page-list-teasers/...
melat0nin replied on at Permalink Reply
melat0nin
Thanks John

The Global Areas block looks pretty good, although it pulls in everything from a given Area, while what I would ideally like is to be able to pull in and position the individual blocks in one of several possible Areas on the parent page, to create a 'masonry' style layout which can differ between the child and parent pages.
enlil replied on at Permalink Reply
enlil
you can also create a stack and then "add stack" to area but only insert a particular block from the stack wherever you want it...
melat0nin replied on at Permalink Reply
melat0nin
Yep I think that's the only approach that will work without some mind-bending code. It's a bit laborious but the end result should be what I'm looking for.
enlil replied on at Permalink Reply
enlil
yes, it would be a bit time consuming getting it set up, but hopefully once it's done it will be one headache crossed off the list ;)
JohntheFish replied on at Permalink Reply
JohntheFish
Without too much code, a page list template that combines 'page list teasers' for content with one of Dojo's page filter templates (masonry like).