Three cool Blockify tricks you may not know about


Blockify is a PHP framework that helps you use, re-use and share your PHP code, cutting development and testing time in half. We made it to help us get basic web features and layouts together, and since it’s release we’ve been amazed at how it’s been used.

Since we launched Blockify we’ve been working closely with a few developers, trying to understand how they actually use it in the wild. In doing so, we’ve learned a few pretty cool tricks that you might want to try out when you’re starting your next project.

Drop a library in there…


That’s right. Drop library in there. Right inside that block folder. Load it up in a block’s functions.php and that library is just going to be there. Check out this PayPal-cart-in-a-block that @developersteve made.

Block in a Block

Fans of the grid-section would have seen this trick before. If you have a peek inside, you’ll see that you can either pass it a reference to a block that already exists, or it’ll fall back to the default article-single block.

What’s even cooler, is that if you check out the block.json, you’ll see ‘dependencies’ at the bottom. This means that when you blockify install grid-section’ it’ll automatically download the article-single for you.

Helper functions

We’ve been working on integrating Blockify with some of your favourite CMS’s (read: WordPress, Joomla (coming soon), Drupal (also coming soon)). There are currently some WordPress helper functions that you should check out in the meantime:

bwp_get_nav_menu_items() — Pass this the ID of whatever nav menu that you want to use and pass it into header-simple as an argument for the links list

bwp_get_the_content() — Returns the_content() filtered so you get all the nice helper functions etc.

bwp_get_the_post_thumbnail_src() — Returns the post thumbnail source of the current post.

That’s about it for now. Let us know any other cool stuff you’re doing with Blockify.

Email me when Blockify publishes or recommends stories