Simpleviews on Drupal 7 - how we did it

Early on in the development of Drupal Gardens, it was clear that we needed some type of simple Views-like functionality. You know, letting users set up simple lists of content beyond what is included with Drupal 7 core, but simpler than the Views UI which can be quite intimidating to first-time users. Drupal Gardens' goals include making Drupal easy to use, and that sometimes comes with feature sacrifices. You cannot do everything you could do with a self-hosted solution, but you can do most things easier. If you exceed what Drupal Gardens can do, no worries, simply export your code and database and adopt any Drupal 7 module.

So when looking at our options for implementation, we had the obvious choice to roll our own code and live with that or postpone this feature to get released with Views D7. There is some very nice discussion going on around the Views D7 UI at and it is evident it is not a small task. For Gardens, we needed a very easy to use UI with a limited feature set. And of course there is a module for that, its called Simpleviews, from Jeff Eaton himself.

We decided to contribute to the community efforts within our limited scope, so we took Simpleviews and upgraded it to Drupal 7 and posted it for review in the issue queue. But Simpleviews depends on Views, right? So without a Drupal 7 version of Views, how useful could that all be? Whether by chance or Jeff Eaton's genius, Simpleviews is actually a pretty standalone module. It only requires Views where it clears the Views cache. The architecture of Views lends itself very well to these kinds of alternative interfaces because it works with array dumps, so an alternate UI module can just have its own ways to generate these arrays.

The original Simpleviews UI screenshot from the module's page

Simpleviews itself stores all simpleview settings in a database table and generates Views arrays out of that. So if we don't have Views, we can just look at the settings in the database and generate output based on that. This way we get the best of Simpleviews by being forward compatible with Views if we later decide to include Views in its entirety, while we can have a very simple and lightweight module to generate output for the small use-cases we cover today. Because Simpleviews is indeed very simple, the backend for generating pages based on the settings there is also surprisingly simple.

My initial version of this backend module was 167 lines with plenty of code comments, which covered all kinds of funky Simpleviews features, except exposed filters. Honestly, we attempt to practice restraint around adding more features to it, but currently it already grown to 460 lines to support some additional things like taxonomy term based filtering and style support for blocks. It is still a little-bitty module compared to Views.

What are we going to do with this feature in the future? Well, we are still not decided yet. We certainly want to provide a lot more Views-like functionality and features this year, but we are starting with design and UX first -- and then we will decide what back-end supports it best. We might use all or some of Views in the future, we might tone down its UI, we might use another alternate UI, we might keep using an alternate backend. It is an ongoing discussion at the Gardens team at this stage. I believe that there is no point in publishing our current backend module on given its interim nature, but that does not make it closed source or unreleased. Any Gardens site that is exported will include a copy of this module, and it is released under the GPL.

What do you think about our approach? How would you make the Views user-experience so easy anyone could use it without getting help? If your suggestion pertains to the Views module itself, please contribute to the existing groups discussion, otherwise leave a comment. Thank you!


daniel's picture

is there a way with Drupal Gardens' current Simpleviews features to create a view / block that displays content that's related to the current node?

for example as demonstrated in these tutorials:

Gábor Hojtsy's picture

We currently use simpleviews as developed with minimal addons. Simpleviews only allows simple node lists by some easily understood criteria. Relationship based views is not supported by simpleviews and neither our very simple additions to it. A more complex views solution is on our roadmap and we are making progress towards that.

Dodazzi's picture

I believe such a module deserve inclusion in the next version of Drupal.
The lack of a way to create custom node listings (excluding through taxonomies) is, in my opinion, the biggest issue of the forthcoming release. We have in place a really complete and versatile system to create custom content types but we still must rely on contrib modules to be able to build simple websites because of the lack of such a feature. Feature wise Drupal is not well balanced and out of the box gives the impression of a CMS to create old style news websites where you can just set up a frontpage listing all articles organized in categories.
Do you think the code of simple views (or a stripped down version of it) could worth a discussion for its inclusion in core, so late in the game?

Gábor Hojtsy's picture

It was a goal for Drupal 7 indeed to include simple views like functionality, but people did not pick up the task that much. A listing API was just committed, but that is short from an actual UI to build those listings. Given how versatile Views is, and how such a new core feature would need to be to some degree backwards compatible (to migrate simpler views to it) and totally forwards compatible (so you can migrate from it to views if you need more complex stuff), I can understand why people did not take on this endeavor.

Dodazzi's picture

I know, it's a pity. That was just a rant on a missed opportunity.
By the way, Gardens are growing fast, I'll go and play with the improved theme system asap. But I secretly hope to see a similar hosted solution for pros where I can set up Drupal websites with a click and have control on installed modules and themes without the pains of setting up and tuning the LAMP environment...

valderama's picture

hey gabor!

i really appreaciate a _simple_ version of the views module, and have tried it out on drupal gardens. As I want to include it in a current project, I wonder how to get this module as on there is no D7 version so far. Should I just export my drupal gardens site and extract the simpleviews module, or is there another way to get this module?


Gábor Hojtsy's picture

We posted our updated code at and then its up to the maintainer to accept it or post comments and requests. It got little attention unfortunately. Drupal Gardens includes the patched version due to that unfortunately. We also have this simple backend module there, which actually serves the pages created with simpleviews. Currently the only way to get that module is to export a site from Drupal Gardens. You can get the simpleviews update by checking out latest D6 simpleviews and applying our patch posted at

Add new comment