hard code scrapbook block

Permalink 2 users found helpful
Hi,

I have added a block from one of my single pages to scrapbook and would like to add it to an area on all of the pages in my theme without pasting it from the scrapbook on every page. Is this possible?

Thanks

- Jack

JackRoyleMBS
 
jereme replied on at Permalink Best Answer Reply
jereme
Certainly.. Assuming your scrapbook item is named "My Scrapbook Item", you'd place the following in your code:

$block = Block::getByName('My Scrapbook Item');
$block->display();


Easy as that!
bryanlewis replied on at Permalink Reply
bryanlewis
Does this still work Jereme? I'm pasting this into my page-type but its not showing up.
LucasAnderson replied on at Permalink Reply
LucasAnderson
Jereme is right if you're into editing your theme code, but you could also do it easier this way through the concrete5 interface:

http://www.concrete5.org/community/forums/usage/handy-trick-with-pa...
JackRoyleMBS replied on at Permalink Reply
JackRoyleMBS
Thanks Guys!