What if we stopped using Views?

MKorostoff

Views and Panels create a very hard coupling between the front end and the back end that makes it impossible for non-Drupal front end developers to work effectively.

The world of front-end web development has undergone a huge renaissance in the past 3 years.  Modern front end developers are widely adopting new layers of abstraction for familiar technologies (SASS, LESS, CoffeeScript) and new automation strategies (Grunt, Bower, Yeoman, CasperJS, QUnit).  With tools like Backbone.js, Angular.js, and Meteor.js front end developers are now writing complex application logic.  Increasingly, front end developers are demanding new freedoms to use their new skills and tools.

Views and Panels tie the hands of front end developers.  We in the Drupal community are missing out on a huge, exciting, new talent pool.  Developers with a non-Drupal front end background are united in their bewilderment by the Drupal theming layer, and they are increasingly steering clear of Drupal all together as a result.

In this talk, I want to argue that it's us, not them, who is to blame for this.

"But you can override Views templates so easily!" replies the Drupal developer.  Perhaps.  But in this talk I want to argue that that task is logically the responsibility of the back end developer, not the front end developer.

Who has not experienced some version of this interaction:
Non Drupalist: "How do I add a wrapping div around these two fields?"
Drupalist: "Oh, it's simple! You just create a new file in your custom theme called views-view-fields--my-view--my-display.tpl.php and then copy/paste this crazy PHP loop, and then write conditional logic to print your HTML only for certain fields..."

No.  There's a better way.

In this example heavy talk, I'll argue that back end Drupal developers need to start empowering front end developers, and layout a plan for doing so (which doesn't include Views or Panels).  I'll show how my new workflow allows front end developers to work freely, by generating clean, custom HTML from scratch, without caring about the back end.  Finally, I'll show one real-world example of a site I built in this manner, for which almost all the HTML, CSS, and Javascript was written by non-Drupalists before the Drupal backend was even started.

Session Track

Site Building

Experience Level

Intermediate

Drupal Version