Develop Schema-compliant PHP websites quickly with Blockify
Blockify is an open source framework that lets you develop websites using self-contained , reusable ‘blocks’ of PHP, Javascript and CSS, saving you development time.
Blockify is an open source framework that lets you develop websites using self-contained , reusable ‘blocks’ of PHP, Javascript and CSS, saving you development time.
1
// Load Blockify framework
require 'blockify/load.php';
// Use block
block('google-map', [
"@type" => "GeoCoordinates",
"latitude" => "51.492140",
"longitude" => "-0.193028"
]);
2
// Block Arguments
block($name, $data, $options, $container);
block().1. Call your block by referencing its name, then pass data into your block as an array
2. Blocks take four arguments; the name of the block, the data that you're passing into your block, any options that block might have and whether to include the Bootstrap container class or not
3
// my-block.php
$block->open();
$block->document->tag('img', 'image');
$block->document->tag('h1', 'name');
$block->document->tag('p', 'description');
$block->close();
4
// block.json
{
"name": "my-block",
"description": "foo bar",
"template": {
"@type": "Thing"
}
}
5
/* block.less
* Blocks are automatically
* given ids that match their
* 'name' for greater
* encapsulation.
*/
#my-block {
/* ... */
}
3. Code your block with the everything that it needs to function and you’ll never touch it again. Leave the project-specific stuff to external stylesheets and Javascript like you would normally.
4. Easily integrate valid Schema.org structured data markup into your page just by referencing what data your block can contain.
5. Work the way you want with integrated build scripts to support your favorite preprocessors.
6
$ npm install -g blockify
$ blockify install header-simple
7
$ blockify init
$ blockify register my-block git://github.com/yourname/my-block.git
6. Use the Block Manager and install free blocks from the Blockify registry (powered by Bower).
7. Publish your own blocks to the registry and quickly deploy them to your new projects.
Bye bye copy/paste.
We’ll get you up and running with Blockify in under 30 minutes. If you’re completely new to things like the command line then start here:
Getting Started with Blockify Watch the videos
The quickest way by far to get started with Blockify is using git and NPM.
$ mkdir my-project && cd my-project
$ git clone https://github.com/blockify/blockify.git
$ npm install -g blockify
Blockify is an open source project and is available on GitHub, licensed under the GNU General Public License v3.
Blockify uses JSON-LD with the schema.org vocabulary to structure data, this creates a smooth experience when working between different blocks and helps block engineers markup their blocks with microdata.
In addition to vanilla CSS and JS, Blockify includes support for the popular preprocessors, LESS, SASS and CoffeeScript with the use of Grunt.
Blockify works great when mixed with Bootstrap. Although Blockify uses Bootstrap in the documentation and starter blocks, you don't have to use it in your project.