Adding content through composer on Page Type template

Permalink
Hi all

Hope you can help.

We have built a site for a client and want to add dummy content to a page type to make it easier for them to update/edit and see where content should be placed.

We have used composer for most fo the blocks but can't see a way of adding content to it through the page type. When editing the page type through the 'output' option we don't get a composer option. Tried the others too.

Only seems content can be added to attributes only.

Is their a way around this?

senshidigital
View Replies:
A3020 replied on at Permalink Reply
A3020
I think this should do it:

1. Go to Page Types -> Edit Form and add a Block (first tab), e.g. 'Content'.
2. Go to Page Types -> Output -> Edit and add a 'Composer Control' block to an area.
A3020 replied on at Permalink Reply
A3020
Or do you want to add default text to the default (content) blocks? I'm not sure if that can be done without hacking a block. E.g. changing the `composer` method of a block's controller.
senshidigital replied on at Permalink Reply
senshidigital
Thanks for the reply.

Yeah we have that in place but what I am after is adding content to a block.

For example we have a 'introduction' content block and want dummy text in here but see no way of adding this in to the page type template.
A3020 replied on at Permalink Reply
A3020
I don't know of a way via the GUI. What you'd try is to hook into the `on_page_add` event. It's triggered when a draft is created.

1. Hook into event
2. Get associated page object
3. Check if page type is xxx
4. If so, get area
5. Loop through blocks in the area
6. Get the block controller
7. Save data
senshidigital replied on at Permalink Reply
senshidigital
Thanks. Will take a look. :)