Blocks are small chunks of content that sit beside your pages. At the moment you need to edit and create blocks manually. You will find your blocks in the blocks (admin/blocks/) folder. Pixie comes with a number of examples to get you started. Example blocks include:
We are currently looking at ways to make block handling much easier from within the Pixie interface. If you have any ideas on how we could do this please share them in the forums.
This block is very simple and is made only from HTML. Lets take a look at the code:
As you can see the structure of a block is very simple. Things to remember are giving the block a unique ID and making sure the block contains the three div sections: block_header, block_body and block_footer.
Lets move on to a slightly more complex example. This time we will be using the SimplePie library bundled within Pixie to create an block that contains an RSS feed from BBC news:
As you can see creating blocks is very simple. Feel free to pick apart the blocks that Pixie ships with to see how they work as this is often the best way to learn and move forward. If you do create your own blocks please post the code back to the community via the Pixie forums so we can see what they are being used for.
As mentioned at the beginning of the article we are looking for better ways to handle blocks in Pixie. At the moment we are considering moving the blocks to a database where they can be saved as sets. Each set can then be applied to a page allowing for unique combinations of blocks and easy editing of them via the Pixie interface.
If you have questions or comments about this page head to the Pixie forums.