Jump to content
Rikki

IP.Content 2.3 Dev Update: Introducing Block Templates

As part of our goal to improve the usability of IP.Content, particularly for non-coder administrators, we've used the 2.3 release to look at ways of reducing or eliminating the amount of code that needs to be written in order to create great websites.

In the current version of IP.Content, blocks require individual templates (entered as part of the wizard process), and the default, unedited HTML is generic and not ideal for most blocks you'd want to create. This clearly left room for improvement, so we're pleased to introduce our solution: block templates. Block templates give us two primary benefits:

  • Make it easier for IP.Content users to set up a good website, without needing to code
  • Make it possible for those who can code to share interesting block interfaces either directly or through the IPS Marketplace

Reusable Block Templates

In IP.Content 2.3, the templates that feed blocks use are created separately, using a new Block Template manager, and then assigned to blocks when they are created:


The block template manager


What does this mean in practice? Firstly, it means that block templates can be used by more than one block, without recoding them, and when changes are made to the template, all blocks update at once. More importantly, it means block templates can be created, exported, shared and imported, so that those with the skills to create them can share them with those who can't. We hope this will spur some great block interfaces from our modding community, to benefit all IP.Content users.

How does it work?

Templates are linked to a feed type and a content type. For example, you might create a template designed for "Topics" in the "Forums" feeds, or "Albums" in "Gallery". In addition, you can create generic templates based on a content type alone, for example "Comments", which can then be used with any feed that shows comments.



Adding a new block template

When feed blocks are created, you are presented with a gallery of all suitable templates. Clicking one previews the template with the real data that the block will generate, so you can see exactly what the block will look like on your pages:



Creating a new feed block using a block template

Of course, if you still wish to provide a custom template for a particular block, you can do so - the process will be exactly the same as before.

A Javascript & CSS framework provided

To go with block templates, we've created a mini Javascript and CSS framework. This means that all block templates, whether they are provided by us or by our modification community, can maintain a consistent style.

The required framework files are automatically injected into all IP.Content pages, whether you use the IP.Board wrapper or your own HTML wrapper.

The javascript side of things is powered by jQuery, and based on the jQuery UI Widget Factory. Block templates can include their own assets, such as javascript widgets, CSS files and images. IP.Content automatically compresses all the JS and CSS files from all templates into a single minified file to help keep websites loading quickly and cut down on HTTP requests.

Sharing templates

As mentioned above, block templates can be exported and shared with other IP.Content users. To make this process very simple, when a template is exported, it's built as an XMLArchive - that means all of your CSS, JS and other assets are compiled into one file for you to distribute (a little like an IP.Board skin is).


Exporting a block template into one XML file

Conclusion

To give you a taste of what is possible with block templates, here's a demo page I've created using some of the default templates we'll be providing. No code - other that putting template tags into a page and adding a div to make the right column - was typed to build this page!


An example page using default templates


Our aim with block templates is to allow all IP.Content administrators to have interesting, useful, interactive blocks, without needing to write the code themselves. The addition of a new standardized JS and CSS framework also means that blocks can maintain consistent styling, regardless of who authored the template.

We'll be including a number of pre-made templates with IP.Content 2.3, and hope that the modification community and other coders will embrace the new possibilities offered by block templates, and create many more to be shared via the IPS Marketplace. Once IP.Content 2.3 is released, we'll publish some developer documentation to help you get started with the new tools.

We think block templates are a huge step forward in making it easier to create websites using IP.Content. We hope you exploit their full potential!


We look forward to your suggestions and ideas for improving the software in our feedback forum. We heavily rely on feedback from all of our clients to shape the future of our software, and even if we don't reply to every topic, rest assured they are all read. If you have any comments on the new block templates feature in IP.Content 2.3, please share your thoughts below!

×
×
  • Create New...