Possible to define in page type files the blocks that'll go in the areas?
I've created a page type that my content managers use to write news stories. I'd like every one of those pages to have a Page List block in the sidebar, listing the latest news. How can I do that, without having the content managers to add that block every time?
I know that in a page type template file I can set up areas through "new Area()". So my question is if it possible to have an area automatically pre-populated with a given block?
Also changes you make to those blocks will take affect in the existing pages.
Another way is to do it with code in the template:
<? $bt = BlockType::getByHandle('autonav'); $bt->controller->displayPages = 'second_level'; $bt->controller->orderBy = 'display_asc'; $bt->controller->displaySubPages = 'relevant_breadcrumb'; $bt->controller->displaySubPageLevels = 'enough'; $bt->render('view'); ?>
I have edited the default page under page type. It looks good...what I'd like to clarify is the statement that changes to blocks will "take affect in existing pages."
I have seen that if i add a block, say to the sidebar, then go and create new pages with that page type, it works. Old pages with the same page type do not inherit this new "default" sidebar. Even if i cahnge the page type to full and back to right sidebar, for example.
also, changes to the default do show up on the newly created pages, but only if i modify the block that was there when i created the new page. If i add a new block to the default page type, that block does not show up on the real pages.
To me, this option is pretty powerful. Nobody likes doing the same thing multiple times, like adding a block to each page that already exists. Does it seem like there would be a way to make these default page types act more like a template, that can be applied to existing pages?
like most people here, love c5, really trying to get into it.
If you want to update all pages using that type to have the new block you made, its quite simple.
Stay in edit mode.
Instead of editing the specific block, look towards the bottom of the menu of options.
There's a command there called Set on Child Pages (or something along those lines).
That gives you an interface to push the new block out to all, or only specific, pages following the type.
Oh, and yes if you change a block in defaults, any pages that already had it should reflect the changes.
Even if the default blocks in a page type are simple blocks instead of global blocks?
I didn't know this...