Having More Fun with Boxes, View and Field Boxes

Posted Aug 31, 2011 // 0 comments
Erik:

screen shot of box interface
Boxes has become one of those modules that we have on every site we build now. Boxes allows for better block creation by making it so each instance of a block has its own instance. Boxes is written in an Object Oriented way that allows you to create your own box types. We've created two new boxes that provide a lot of flexibility: Field Boxes and Views Boxes.

Views Boxes

So why would we want a box that has a view in it when we already have blocks for views? That is a good question. One thing that people often want is a view of articles, but they still want to be able to curate that list.

We solved this is the past by making a node queue and using it in the view. But what if you want to have an arbitrary number of similar curated views? Or what if you want that same view in different places, but have it limited by blog post? This is where Views Boxes come into play.

Screen shot of field box interface
When you create a new field box, the first thing you do is select the view. Then it processes the view, and the second part of the box config is any exposed filter or contextual filter (use to be arguments). So I can make one view, that has exposed filter on content type, and a argument to accept node ids for ordering, and then use this view in as many boxes as I want. Basically we are using the power of views to not only deliver the content, but also to construct the configuration.

Field Boxes

Field box is used for pulling any field for any entity into a box. It is pretty straight forward. You pick the type of entity object you want (you can also choose the current loaded one for nodes and taxonomy terms), then the field or fields you want (they can also be ordered), and then display mode to used when building the output.

Our current use case for this is mostly moving fields that are on a node into the sidebars and headers and such. It can be nice when used with Context Field when a node has its own context for configuration.

We are also using it to pull images attach to taxonomies on to node pages. One of the things that will hopefully get added to field boxes is the option to edit the field from the box. This will help when fields are placed on pages other than the node from which they came.

Attachments

field_box.png
About Erik

When Erik Summerfield joined our software development team, we knew that his natural talents in math and economics would be an asset to our team and clients alike. Plus, his experiences in various programming languages including .NET/C#, perl, ...

more >

Read Erik's Blog

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <strong> <code> <p> <img> <ul> <ol> <li> <h2> <h3> <h4> <b> <u> <i>
  • You may insert videos with [video:URL]

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.