Question about pages and blocks (I need a shortcut!)

Permalink 1 user found helpful
A client has asked me to add a formatted autonav breadcrumb and a graphic horizontal line to the top of every page of a catalog on his site. Being a client, he asked me to do this after I had initially recommended it, he rejected it, and I had built out the 150 pages. Now he sees why and wants it. Familiar?

Is there any way of making the process shorter than editing each page, adding two disparate items from the scrapbook, moving them to the top of the page, and then saving each of the pages??
Any advise will be very much appreciated.

btugwell
 
Mnkras replied on at Permalink Reply
Mnkras
i am assumming you know how to use pagetype defaults, go into edit mode on the pagetype default page go to the block that you changed, click it and select apply on child pages pick the pages.

Ta da!
btugwell replied on at Permalink Reply
btugwell
I knew about page types, but I didn't know about apply on child pages - that's awesome.
Thanks
Tony replied on at Permalink Reply
Tony
i normally hardcode stuff like this to the pagetype. you can do that with a global block pretty easily
btugwell replied on at Permalink Reply
btugwell
I considered that, but in this case I have used the page type for more than one kind of page layout and some pages didn't include the breadcrumb. In this case Mnkras's solution was perfect, and frankly I hadn't seen the function so i was glad to learn about it. I haven't hardcoded a block in however either. Is there a thread or page that might give me an overview of the method?
Tony replied on at Permalink Reply
Tony
here's a couple of quick examples...

Hardcoding a global block to a page:

$block = Block::getByName('MailingListBox'); 
if( is_object($block) ) $block->display();



And the standard way to hardcode a block that's not in the scrapbook:
$bt = BlockType::getByHandle('autonav');  
$bt->controller->displayPages = 'top_level'; 
$bt->controller->orderBy = 'display_asc';
$bt->controller->displaySubPages = 'none';
$bt->controller->displaySubPageLevels = 'custom';
$bt->controller->displaySubPageLevelsNum = '1';   
$bt->render('view'); 
//$bt->render('templates/inneroptics_header');