<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://groups.drupal.org" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Views Developers</title>
 <link>http://groups.drupal.org/views-developers</link>
 <description>People interested in the development of Views, Views API and modules that utilize Views.</description>
 <language>en</language>
<item>
 <title>Starting Views2 Documentation</title>
 <link>http://groups.drupal.org/node/10129</link>
 <description>&lt;p&gt;Creating this wiki page as a dumping ground for bits of documentation on Views2. It&#039;s totally a work in progress that can serve as a basis for future handbook pages.&lt;/p&gt;
&lt;h2&gt;Hooks&lt;/h2&gt;
&lt;p&gt;Merlin keeps changing the signatures so go check the code to see how they&#039;re really supposed to be used, this should just give you an idea what&#039;s out there.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;hook_views_data&lt;/dt&gt;
&lt;dd&gt;Tells views about the tables, field, filters, arguments, etc.&lt;/dd&gt;
&lt;dt&gt;hook_views_default_views&lt;/dt&gt;
&lt;dd&gt;Lets modules provide default views.&lt;/dd&gt;
&lt;dt&gt;hook_views_convert&lt;/dt&gt;
&lt;dd&gt;Converting views1 views to views2.&lt;/dd&gt;
&lt;dt&gt;hook_views_query_substitutions&lt;/dt&gt;
&lt;dd&gt;Query substitutions&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2&gt;Terminology&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;Pseudo Table&lt;/dt&gt;
&lt;dd&gt;
A pseudo table is not much more than defining the name of the table as a table that doesn&#039;t exist. For example, &lt;code&gt;$data[&amp;#039;term_data_&amp;#039; . $vid] = array(...);&lt;/code&gt; Then, in that data, you need to tell it that &#039;table&#039; =&amp;gt; &#039;term_data&#039; so that it knows it&#039;s the real table. And in the &#039;extra&#039; part of the join, you generally do something like &lt;code&gt;&amp;#039;vid&amp;#039; =&amp;gt; $vid&lt;/code&gt;&lt;br /&gt;
If you&#039;ve got a SQL background you may know this as an aliased table that&#039;s added to the query as part of a complex join e.g.:&lt;br /&gt;
&lt;code&gt; LEFT JOIN {term_data} term_data_1 WHERE term_data_1.tid = term_node_1.tid AND term_data_1.vid = 1&lt;/code&gt;&lt;br /&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2&gt;Easy embed&lt;/h2&gt;
&lt;p&gt;Note that this function passes any additional parameters to the View as Arguments.&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;/**&lt;br /&gt; * Embed a view using a PHP snippet.&lt;br /&gt; *&lt;br /&gt; * This function is meant to be called from PHP snippets, should one wish to&lt;br /&gt; * embed a view in a node or something. It&amp;#039;s meant to provide the simplest&lt;br /&gt; * solution and doesn&amp;#039;t really offer a lot of options, but breaking the function&lt;br /&gt; * apart is pretty easy, and this provides a worthwhile guide to doing so.&lt;br /&gt; *&lt;br /&gt; * @param $name&lt;br /&gt; *&amp;nbsp;&amp;nbsp; The name of the view to embed.&lt;br /&gt; * @param $display_id&lt;br /&gt; *&amp;nbsp;&amp;nbsp; The display id to embed. If unsure, use &amp;#039;default&amp;#039;, as it will always be&lt;br /&gt; *&amp;nbsp;&amp;nbsp; valid. But things like &amp;#039;page&amp;#039; or &amp;#039;block&amp;#039; should work here.&lt;br /&gt; * @param ...&lt;br /&gt; *&amp;nbsp;&amp;nbsp; Any additional parameters will be passed as arguments.&lt;br /&gt; */&lt;br /&gt;function views_embed_view($name, $display_id = &amp;#039;default&amp;#039;) {&lt;/code&gt;&lt;/div&gt;
&lt;h2&gt;API&lt;/h2&gt;
&lt;p&gt;Earl&#039;s been using Doxygen to generate API documentation: &lt;a href=&quot;http://views2.logrus.com/doc/html/index.html&quot; title=&quot;http://views2.logrus.com/doc/html/index.html&quot;&gt;http://views2.logrus.com/doc/html/index.html&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Load a view:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$view &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;views_get_view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;view_name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Initalize it and add arguments:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;set_display&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;page&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;set_arguments&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;first&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;second&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;));&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;is_cacheable &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Or add a filter. Works for fields, sorts, and arguments as well.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$display_id &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;default&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;set_display&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$display_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;add_item&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$display_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;filter&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;og_uid&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;is_admin&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$item &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;get_item&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$display_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;filter&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$item&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;value&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;set_item&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$display_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;filter&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$item&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;is_cacheable &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Get an array of the view result objects:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;execute&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;foreach (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;result &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp; foreach (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;field &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!empty(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;pre_render&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// Do something with this unrendered result object&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt; }&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Another way to get array of results:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;render&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;foreach (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;result &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// Do something with this rendered result object&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Use a custom display plugin&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$display_id &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;add_display&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;my plugin&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;render&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$display_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Another method&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$view &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;views_get_view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;my_view&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;execute_display&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$display_id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$args&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;h2&gt;Writing Views 2 style and row plugins&lt;/h2&gt;
&lt;p&gt;The Views 2 API has changed significantly from Views 1: it has been reorganized and is now much more object-oriented, but the basic concepts remain the same. You use the Views UI as a dynamic query builder to construct lists of nodes based on fields, arguments, filters, and sort criteria, which can then be styled and displayed in quite a number of ways. You use style plugins to display nodes in any type of format from simple HTML tables to more exotic formats based on XML and JSON. In this tutorial I&#039;ll go over the steps I took to create a new Views 2 style plugin for rendering nodes in the JSON data format and a Views 2 row plugin used by my style plugin .&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5203486865179687938&quot;&gt;&lt;img src=&quot;http://lh5.ggpht.com/allister.beharry/SDZ_vBByPAI/AAAAAAAAAOw/NiytBMLJugA/s400/views2-newstyleplugin3.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
New Views styles for displaying nodes in the JSON data format &lt;/p&gt;&lt;/p&gt;
&lt;p&gt;A complete style plugin is made up of these four components:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;An implementation of &lt;a href=&quot;http://views2.logrus.com/doc/html/group__views__hooks.html#g23f6e9972b2ed84fc54b7ff63f44477d&quot;&gt;hook_views_plugins&lt;/a&gt; to declare your style plugin;&lt;/li&gt;
&lt;li&gt;An implementation of the &lt;a href=&quot;http://views2.logrus.com/doc/html/classviews__plugin__style.html&quot;&gt;views_plugin_style&lt;/a&gt; class;&lt;/li&gt;
&lt;li&gt;A theme preprocess function for your style theme;
&lt;li&gt;A theme .tpl.php page.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;0)Organizing the module files. Views 2 automatically looks for plugins supplied by modules in files named &lt;i&gt;module_name.&lt;/i&gt;.views.inc. They can be in the module directory or an &#039;includes&#039; sub-directory. My module will be called views_json so in my views_json folder I have a views_json.views.inc code file. json_views.module is empty but could contain unit tests for the plugin.&lt;/p&gt;
&lt;p&gt;1)Declaring the plugins&lt;br /&gt;
Whereas in Views 1.x you declared your style plugins by implementing hook_views_style_plugins, all Views 2 plugins are declared by implementing  hook_views_plugin and indicating the plugin type as the name of the top-level array containing your plugin definition:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt; * Implementation of hook_views_plugin&lt;br /&gt; *&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;views_json_views_plugins&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; return array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;style&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array( &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//declare the views_json style plugin&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;views_json&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;title&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;JSON data document&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;theme&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;views_view_json&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;help&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Displays nodes in the JSON data format.&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;views_plugin_style_json&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;uses row plugin&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;uses fields&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;uses options&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;type&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;normal&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;row&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array( &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//declare the unformatted row plugin&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;unformatted&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;title&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Unformatted&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;help&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;(Displays the unformatted data for each row from the views query with each row on a new line. Set as | for views_json.&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;views_plugin_row_unformatted&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;theme&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;views_view_row_unformatted&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;uses fields&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;uses options&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;type&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;normal&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&amp;nbsp; &lt;br /&gt;&amp;nbsp; );&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;In this case I&#039;m declaring a &lt;a href=&quot;http://views2.logrus.com/doc/html/classviews__plugin__style.html&quot;&gt;style plugin&lt;/a&gt; called views_json and a &lt;a href=&quot;http://views2.logrus.com/doc/html/classviews__plugin__row.html&quot;&gt;row plugin&lt;/a&gt; called unformatted. I need the row plugin because I want to get at the unformatted text for each record returned from the views query, and the default row plugin adds a lot of html formatting that I don&#039;t want.&lt;/p&gt;
&lt;p&gt;2)Implementing views_plugin_style and views_plugin_row. One cool thing about Views 2 is that &lt;i&gt;every&lt;/i&gt; default display type, style, and row are implemented as plugins derived from base classes from the root superclass &lt;a href=&quot;http://views2.logrus.com/doc/html/classviews__plugin.html&quot;&gt;views_plugin&lt;/a&gt; So I could just look at the code written for the default plugins to have a really  good guide on how to implement my own.&lt;/p&gt;
&lt;p&gt;I created a class views_plugin_style_json (inside views_json.views.inc) deriving from views_plugin_style:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt; * Implementation of views_plugin_style&lt;br /&gt; *&lt;br /&gt; */&lt;/p&gt;
&lt;p&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;class &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;views_plugin_style_json &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;extends &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;views_plugin_style &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;{&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt;&amp;nbsp;&amp;nbsp; * Set default options&lt;br /&gt;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;format&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Exhibit&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt;&amp;nbsp;&amp;nbsp; * Provide a form for setting options.&lt;br /&gt;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;&amp;nbsp;&amp;nbsp; * @param array $form&lt;br /&gt;&amp;nbsp;&amp;nbsp; * @param array $form_state&lt;br /&gt;&amp;nbsp;&amp;nbsp; */&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;options_form&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$form_state&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;format&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#type&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;radios&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#title&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;JSON data format&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#options&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Exhibit&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;MIT Simile/Exhibit&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Canonical&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Canonical&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;), &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;JSONP&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;JSONP&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#default_value&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;format&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;If you&#039;re curious about the base views_plugin_style class and all the members our class inherits, you can view the source  &lt;a href=&quot;http://views2.logrus.com/doc/html/plugins_8inc.html&quot;&gt;here&lt;/a&gt;. Most of the boilerplate code for setting up a views style plugin is done already in the base class, I just need to implement my custom bits (+1 for OO). My implementation does only one custom thing - provide a form for users to select the JSON format they want to render. This is done by implementing &lt;a href=&quot;http://views2.logrus.com/doc/html/classviews__plugin.html#1aaed8da1afd9f45293a37358c159837&quot;&gt;options_form&lt;/a&gt;.&lt;br /&gt;
Form building for options form is similar to building forms through the Form API. An options form can be very simple, like ours which is just presenting a single set of radio buttons, to a very complex one like the one the table style uses:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5206962129377311826&quot;&gt;&lt;img src=&quot;http://lh5.ggpht.com/allister.beharry/SELYeBByPFI/AAAAAAAAAQ0/g0s5tj12Gx8/s400/views2_table_style.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Table style options form &lt;/p&gt;
&lt;p&gt;In the next iteration of our JSON plugin we&#039;ll use a more advanced options form to allow the user to select what fields to render and maybe use different labels for field.&lt;/p&gt;
&lt;p&gt;For our row plugin we follow the same pattern: we extend &lt;a href=&quot;http://views2.logrus.com/doc/html/classviews__plugin__row.html&quot;&gt;views_plugin_row&lt;/a&gt; inside views_json.inc:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt; * Implementation of views_row_plugin&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;class &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;views_plugin_row_unformatted &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;extends &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;views_plugin_row &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Set default options&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @param array $options&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;separator&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;|&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt;&amp;nbsp;&amp;nbsp; * Provide a form for setting options.&lt;br /&gt;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;options_form&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$form_state&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fields &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;display&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;handler&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;get_option&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;fields&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$options &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= array();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fields &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$handler &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;views_get_handler&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;table&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;], &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;field&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;], &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;field&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$handler&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$handler&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;ui_name&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$form&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;separator&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#title&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Separator&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#type&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;textfield&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#size&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#default_value&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;separator&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]) ? &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;separator&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] : &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;,&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;#description&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;The separator is placed between fields.&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;In this case we also have an options form which is displayed to the user for selecting a field delimiter.&lt;/p&gt;
&lt;p&gt;You&#039;ll notice that we have reference to &#039;handlers&#039; in each bit of code Each view has handlers designed to respond to certain actions. @TODO: explain handlers (not needed for the rest of the tutorial)&lt;/p&gt;
&lt;p&gt;Once we have our options  form setup we can process to the heart of the style plugin - the theme template preprocess function and most importantly, the theme template.&lt;/p&gt;
&lt;p&gt;3) (optional) Implement template_preprocess_&lt;br /&gt;
Inside template_preprocess_  you setup variables to be accessed by the plugin theme template .tpl.php file.You can also modify variables before they are passed to the theme template. You can read more about template_preprocess functions here:&lt;a href=&quot;http://drupal.org/node/223430&quot;&gt;http://drupal.org/node/223430&lt;/a&gt; as they are part if the standard Drupal theme system. In the class we extended - views_plugin_style - there is &lt;a href=&quot;http://views2.logrus.com/doc/html/classviews__plugin__style.html#a52b618e91b11a7d10ad1feadbc891f1&quot;&gt;this method&lt;/a&gt; defined:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;render&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (empty(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;row_plugin&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;vpr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;views_plugin_style_default: Missing row plugin&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rows &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= array();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;result &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rows&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[] = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;row_plugin&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;render&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;theme_functions&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(), &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;options&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rows&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://views2.logrus.com/doc/html/classviews__plugin.html#b20d2d49f24db9ee7f162341564fd2fd&quot;&gt;theme_functions()&lt;/a&gt; returns a full list of possible theme templates used by this style. render() is what is called by the view&#039;s display for the style plugin to do it&#039;s thing. In addition to the variables we define in our preprocess function, the most important of the variables is provide automatically to the theme: $rows. Style templates boil down to iterating through the $rows variable and spitting out some markup. We&#039;ll get to the style template in a minute. If you don&#039;t need any other variables other than $rows and $options and you don&#039;t need to modify these variables, can omit the preprocess function which will be fine for our simple style plugin.&lt;/p&gt;
&lt;p&gt;It&#039;s &lt;b&gt;very important&lt;/b&gt; to note that if you do use template_preprocess functions, they are defined &lt;b&gt;outside&lt;/b&gt; your views_plugin class definition.&lt;/p&gt;
&lt;p&gt;Our row plugin template_preprocess looks like this (inside views_json.inc but outside views_plugin_row_unformatted):&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/**&lt;br /&gt; * Theme preprocess function for views-view-row-unformatted.tpl.php&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;template_preprocess_views_view_row_unformatted&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&amp;amp;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;view&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//print(&#039;preprocess&#039;);&lt;br /&gt;&amp;nbsp; // Loop through the fields for this view.&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;foreach (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$view&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;field &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!empty(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]) &amp;amp;&amp;amp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;is_object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= new &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;stdClass&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;content &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;theme&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;row&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;field_alias&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) &amp;amp;&amp;amp; isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;row&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]-&amp;gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;field_alias&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;})) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;raw &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;row&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]-&amp;gt;{&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;field_alias&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;};&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;raw &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// make sure it exists to reduce NOTICE&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!empty(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;options&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;separator&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]) &amp;amp;&amp;amp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;content&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;separator &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;filter_xss_admin&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;options&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;separator&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;handler &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;class &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;views_css_safe&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;label &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;check_plain&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$field&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;handler&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;label&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$vars&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;fields&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$object&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;It looks more complex but it follows the same pattern as for a style plugin (remember Views 2 is very OO.) Row plugins automatically provide an array variable call $fields to the theme, which contains each field value and field label for the row to be rendered. They also have analogous render() and theme_functions() methods implemented in the base &lt;a href=&quot;http://views2.logrus.com/doc/html/classviews__plugin__row.html&quot;&gt;views_plugin_row class&lt;/a&gt; Before the plugin themes the row we can modify the $fields by modifying the $vars[&#039;fields&#039;] array.&lt;/p&gt;
&lt;h2&gt;Upgrading from Views 1.x to Views 2: A user&#039;s perspective&lt;/h2&gt;
&lt;p&gt;Views 2 is the newest major release of Views specifically coded for Drupal 6. Views 2 retains all of the core functionality of Views 1, together with a completely revamped user interface, and a large set of new features which enhance the original feature-set of Views 1. This document is a side-by-side comparison of Views 1 vs. Views 2 from a user&#039;s perspective, detailing the UI changes, some new ways to perform old tasks, the cool new feature of Views 2 and how these features can be used to address some of the shortcomings of Views 1.&lt;/p&gt;
&lt;h2&gt;Admin interface&lt;/h2&gt;
&lt;p&gt;The first thing that pops out after you install Views 2 is the radically different admin interface:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5202188535678660674&quot;&gt;&lt;img src=&quot;http://lh3.ggpht.com/allister.beharry/SDHi6Su8cEI/AAAAAAAAAKQ/f57OeoLsc1w/s400/views2-admin.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Views 2 admin interface&lt;/p&gt;
&lt;p&gt;compared to the old comfy Views 1 interface:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5202188531383693362&quot;&gt;&lt;img src=&quot;http://lh6.ggpht.com/allister.beharry/SDHi6Cu8cDI/AAAAAAAAAKI/FejN8p8N8EA/s400/views1-admin.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Views 1 admin interface &lt;/p&gt;
&lt;p&gt;The new admin interface performs the same functions as the old - listing all the views in the system, providing links to add or import views and a link to Views Tools - but has been compacted, with each view displayed as a paragraph style-row compared to the table of Views 1 and set of filters on top to ease locating views among a large list.&lt;/p&gt;
&lt;p&gt;Context-help is available by clicking the small blue question-mark icon. Context-help in Views 2 is provided by the &lt;a href=&quot;http://drupal.org/project/advanced_help&quot;&gt;Advanced Help&lt;/a&gt; module so make sure to install that together with installing Views 2. Context-sensitive help is available in many areas of the Views 2 module.&lt;/p&gt;
&lt;p&gt;A couple new attributes of each view are visible in the filter header:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Tag&lt;/b&gt; - This is just another label for organizing and sorting views. Tags can be any text.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Display&lt;/b&gt; - In Views 1 each view query was tied to its display; in other words your fields, sorts, filters, and arguments could only be displayed in the single page or block display provided in the view definition. In Views 2, view displays have been decoupled from view queries - it is now possible to have multiple page, block, and feed displays from a single view. More on view displays later. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Type&lt;/b&gt; - Views 2 view types are radically different from Views 1 types. Views 1 types basically defined how the node list displays were &lt;i&gt;styled&lt;/i&gt; - you had Full Nodes, Teaser List, Table View, and so on. In Views 2 view display styles have been broken out into the separate &lt;i&gt;Style&lt;/i&gt; attribute. View types now refer to the primary table on which information for the query will be retrieved which controls what arguments,fields,sort criteria and filters are available. Views 2 view types are discussed later.
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Adding a view&lt;/h2&gt;
&lt;p&gt;So let&#039;s jump in and add a view&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5202274963305558098&quot;&gt;&lt;img src=&quot;http://lh3.ggpht.com/allister.beharry/SDIxhCu8cFI/AAAAAAAAAK0/WPkNjOPfOUs/s400/views2-addaview.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Adding a view &lt;/p&gt;
&lt;p&gt;The first step in adding a view is simply entering a name (only alphanumeric characters, no spaces,) a description, tag, and the view type. In this case we&#039;re going to create a view with user data.&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5202276359169929314&quot;&gt;&lt;img src=&quot;http://lh4.ggpht.com/allister.beharry/SDIyySu8cGI/AAAAAAAAAK8/WEbJeofEILY/s400/views2-newview.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Configuring the new view&lt;/p&gt;
&lt;p&gt;This might be the 2nd whoa moment as the interface here is also completely revamped from Views 1.x. The best way to summarize is to say all the pieces from the Views 1.x interface are still there...just in different places. Fields, Arguments,Sort critera,and Filters are all there, just in new AJAXY-flavours&lt;br /&gt;
We can start by adding fields:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5202308322316546162&quot;&gt;&lt;img src=&quot;http://lh6.ggpht.com/allister.beharry/SDJP2yu8cHI/AAAAAAAAALQ/jwPXgIJIowc/s400/views2-addfields.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Adding fields&lt;/p&gt;
&lt;p&gt;Clicking on one of the of Fields +widgets unfurls a section at the bottom of the page with all the available fields grouped by Comment, File, Node, Node revision, Taxonomy and User. This is a general paradigm for the Views 2 interface - clicking on a widget or link unfurls a section at the bottom of the page with the relevant interface. In this case you can use the Groups drop-down box to show only a subset of the fields available according to the above groups, or select All to see all fields available. In the shot below, clicking on the Add button for our fields brings up the familiar jQuery &quot;wait&quot; animation as the fields we selected are added to the interface&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5202321885823266946&quot;&gt;&lt;img src=&quot;http://lh4.ggpht.com/allister.beharry/SDJcMSu8cII/AAAAAAAAALg/oSFdPWTOtyQ/s400/views2-addfieldsajax.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Adding fields &lt;/p&gt;
&lt;p&gt;Once we add our fields they show up in the Fields section of the interface where they can be rearranged by clicking the up/down widget. We can also remove a field using the same interface:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5202811151317758114&quot;&gt;&lt;img src=&quot;http://lh6.ggpht.com/allister.beharry/SDQZLSu8cKI/AAAAAAAAAL8/3pH1lizKXas/s400/views2-rearrangefields.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Rearranging fields &lt;/p&gt;
&lt;p&gt;Making a change to usually triggers a refresh of the view preview conveniently located right below the main interface:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5202818457057128626&quot;&gt;&lt;img src=&quot;http://lh3.ggpht.com/allister.beharry/SDQf0iu8cLI/AAAAAAAAAMI/jbsW263vXm8/s400/views2-fieldspreview.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Views preview &lt;/p&gt;
&lt;p&gt;Now that we have some fields setup we can turn our attention to Basic Settings for the view.&lt;br /&gt;
It&#039;s important to note that all the interface elements pertain to the current &lt;i&gt;Display&lt;/i&gt; selected for the view. As mentioned before a view can have multiple displays. The first time you create a view you&#039;ll be manipulating the &lt;i&gt;Default&lt;/i&gt; display. You can add displays using the Add Display button; this lets you have as many displays of a view as you would like all sharing the same Fields, Sort Criteria, Filters and Arguments but using different types of displays like Page, Feed, Block and Attachment.&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5203063063576722274&quot;&gt;&lt;img src=&quot;http://lh5.ggpht.com/allister.beharry/SDT-ShByO2I/AAAAAAAAAMY/rK0m82sqe8M/s400/views2-adddisplay.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Adding a &lt;i&gt;Page&lt;/i&gt; display &lt;/p&gt;
&lt;p&gt;Let&#039;s stick with the Default display and twiddle some settings. We can set the Title to &quot;User View 1&quot; and the Style to Table. As mentioned earlier, view styles in Views 2 correspond more to view types in Views 1.&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5203074582679010194&quot;&gt;&lt;img src=&quot;http://lh4.ggpht.com/allister.beharry/SDUIxBByO5I/AAAAAAAAAM0/hPdyPifocGM/s400/views1-changeviewtype.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Selecting a Views 1 View Type &lt;/p&gt;
&lt;p&gt;In Views 2, view &lt;i&gt;styles&lt;/i&gt; control how a view display looks.&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5203078383725067186&quot;&gt;&lt;img src=&quot;http://lh5.ggpht.com/allister.beharry/SDUMORByO7I/AAAAAAAAANM/UeiQAuylXF8/s400/views2-changedisplaystyle.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Selecting a Views 2 Display Style &lt;/p&gt;
&lt;p&gt;We&#039;re given the style options of &lt;b&gt;Grid&lt;/b&gt;, &lt;b&gt;List&lt;/b&gt;, &lt;b&gt;Table&lt;/b&gt; and &lt;b&gt;Unformatted&lt;/b&gt;. Additional display styles can be added by Views &lt;i&gt;style plugins&lt;/i&gt;. Choosing a style reveals a &quot;settings&quot; button which you can click to configure the style you&#039;ve chosen. In the shot below we&#039;ve selected and are configuring the Table style:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5203086870580444098&quot;&gt;&lt;img src=&quot;http://lh5.ggpht.com/allister.beharry/SDUT8RByO8I/AAAAAAAAANc/lUWl5esvTuE/s400/views2-tablestyle.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Selecting and configuring the table style &lt;/p&gt;
&lt;p&gt;We won&#039;t set any options other than the defaults. Now we can click the preview button to get a live preview of what our view looks like:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5211814936753575538&quot;&gt;&lt;img src=&quot;http://lh4.ggpht.com/allister.beharry/SFQWElRFlnI/AAAAAAAAATI/ItbGdEfCEBs/s400/views15b.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Live preview&lt;/p&gt;
&lt;p&gt;Notice that in addition to the view, we can also see the SQL query that the view is using. This is really useful in debugging complex view queries.&lt;br /&gt;
We can add a filter by clicking on the Filters+ widget which unfurls the filters interface:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5211820667693450866&quot;&gt;&lt;img src=&quot;http://lh5.ggpht.com/allister.beharry/SFQbSKroRnI/AAAAAAAAATQ/xV-feq7n8p0/s400/views16.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Adding filters&lt;/p&gt;
&lt;p&gt;You can select the field you want to filter on, as well as the filter operator and the filter string:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5211826795025269122&quot;&gt;&lt;img src=&quot;http://lh4.ggpht.com/allister.beharry/SFQg20xYAYI/AAAAAAAAATY/BSfubKJpzHM/s400/views17.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Configuring filter&lt;/p&gt;
&lt;p&gt;Sort criteria are added by clicking on the sort criteria + widget:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5211903217451531970&quot;&gt;&lt;img src=&quot;http://lh6.ggpht.com/allister.beharry/SFRmXMfp_sI/AAAAAAAAATg/WQiQGVEEhbQ/s400/views18.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Configuring sort criteria&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;@TODO relationships and arguments&lt;/p&gt;
&lt;p&gt;Anytime we update sort criteria or filters or any element of the view, it triggers a refresh of the live preview. We can get a look at the view we&#039;ve defined at anytime by clicking on the Preview button. Here we have defined an ascending sort, and we filter on e-mail addresses starting with c:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5211910124666971218&quot;&gt;&lt;img src=&quot;http://lh6.ggpht.com/allister.beharry/SFRspP4JZFI/AAAAAAAAATo/6C0e2dAxYvE/s400/views19.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
View preview&lt;/p&gt;
&lt;p&gt;Now that we have defined our view we would like to be able to access it from somewhere other than the Views interface. In Views 1 you would use &quot;Add Page View&quot; to set a URL for the view:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5211915634493732034&quot;&gt;&lt;img src=&quot;http://lh5.ggpht.com/allister.beharry/SFRxp9lNtMI/AAAAAAAAATw/-fwPEDcVkZ0/s400/views20.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Views 1 add page view&lt;/p&gt;
&lt;p&gt;In Views 2 you specify how and where you want to display you view by adding &lt;i&gt;Views displays&lt;/i&gt;&lt;br /&gt;
to your view. If we look at the add display drop-down:&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5216659386135591586&quot;&gt;&lt;img src=&quot;http://lh5.ggpht.com/allister.beharry/SGVMEpjRuqI/AAAAAAAAAZE/8SpxHbAd9z0/s400/views47_.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Views 2 display types&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;The page display the view as a Drupal page with its own URL and menu entry.&lt;br /&gt;
&lt;a href=&quot;http://picasaweb.google.com/allister.beharry/DrupalViews2Documentation/photo#5216662395718366418&quot;&gt;&lt;img src=&quot;http://lh3.ggpht.com/allister.beharry/SGVOz1HudNI/AAAAAAAAAZM/9BxEseUZoZk/s400/views48.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Page display options&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;h2 id=&quot;upgrading-developers&quot;&gt;Upgrading from Views 1.x to Views 2.x: A developer&#039;s perspective&lt;/h2&gt;
&lt;h3&gt;hook_views_tables() is now hook_views_data()&lt;/h3&gt;
&lt;p&gt;The new name for hook_views_tables() is hook_views_data(). That&#039;s about where their similarity ends.&lt;/p&gt;
&lt;p&gt;Views 1.x:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;example_views_tables&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tables&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;Views 2.x:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;example_views_data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;h3&gt;Base (new in 2.x)&lt;/h3&gt;
&lt;p&gt;While Views 1.x could only display lists of nodes and node-related properties, Views 2.x allows modules to define their own top-level type that may be listed.&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;example_views_data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$table_name&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;table&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;base&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;field&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$primary_key&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;title&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$human_readable_name&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;help&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$human_readable_description&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp; );&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;Here&#039;s an example from comment.views.inc:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;function &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;comment_views_data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() {&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;comments&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;table&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;base&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;field&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;cid&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;title&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Comment&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;help&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Comments are responses to node content.&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp; );&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;return &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;This results in &quot;Comments&quot; being one of the &quot;View types&quot; available when creating a view.&lt;/p&gt;
&lt;h3&gt;Table definition&lt;/h3&gt;
&lt;p&gt;In Views 1.x, you needed to specify the &#039;name&#039; and &#039;provider&#039; of a table. In Views 2.x, only the name is specified, along with a &#039;group&#039; that determines how its properties are grouped in the UI.&lt;/p&gt;
&lt;p&gt;Views 1.x:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp; $tables&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;book&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;name&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;book&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;provider&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;internal&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;Views 2.x:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp; $data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;book&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;table&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;group&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&amp;nbsp; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Book&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;h3&gt;Joins&lt;/h3&gt;
&lt;p&gt;The syntax for specifying table joins has changed.&lt;/p&gt;
&lt;p&gt;In Views 1.x, you would specify both the left and right side of a join in a full array syntax. Views 2.x uses a shorter-hand version.&lt;/p&gt;
&lt;p&gt;Views 1.x:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;join&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;left&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;table&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;node&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;field&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;vid&#039;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;right&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;field&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;vid&#039;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// ...&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;Views 2.x:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp; $data&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;book&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;table&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;][&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;join&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;node&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;left_field&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;nid&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;field&#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;nid&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp; );&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Tue, 25 Mar 2008 22:30:23 +0000</pubDate>
 <dc:creator>drewish</dc:creator>
 <guid isPermaLink="false">10129 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Views Theming Documentation</title>
 <link>http://groups.drupal.org/node/4161</link>
 <description>&lt;p&gt;This is an effort to get people in the community to do some work for me. Maybe I&#039;m a bit lazy, but this is a piece of work that I&#039;ve admitted I&#039;m simply never going to get to. Yet it is needed.&lt;/p&gt;
&lt;p&gt;This document is intended to be a &lt;b&gt;comprehensive documented on theming Views&lt;/b&gt;. It should cover all of the basics, and it should also include tutorials. It really needs to be both.&lt;/p&gt;
&lt;p&gt;I want to start with a topic list. I&#039;m not even sure the best way to lay this out, so I&#039;m going to start with the really obvious topics:&lt;/p&gt;
&lt;p&gt;This is a WIKI page. I welcome people to edit this document. Ideally, once parts of this document are ready they can be moved to drupal.org, but this is an excellent place to work from.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;How Views are themed, in general&lt;/dt&gt;
&lt;dd&gt;TODO&lt;/dd&gt;
&lt;dt&gt;How to theme a basic view&lt;/dt&gt;
&lt;dd&gt;TODO&lt;/dd&gt;
&lt;dt&gt;How to theme a single field for a view&lt;/dt&gt;
&lt;dd&gt;TODO&lt;/dd&gt;
&lt;dt&gt;How to write a Views plugin &lt;/p&gt;
&lt;dd&gt;TODO&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2&gt;Overview&lt;/h2&gt;
&lt;p&gt;The term &quot;Views Theming&quot; covers a range of activities around formatting Views output. These include:&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;CSS&lt;/dt&gt;
&lt;dd&gt;The Views output contains a rich set of div tags allowing fine-grained CSS control over the output.&lt;/dd&gt;
&lt;dt&gt;List View Item Formatting&lt;/dt&gt;
&lt;dd&gt;With example code provided by the Views Theme Wizard a PHP template file can be used to format the output of a list view.&lt;/dd&gt;
&lt;dt&gt;Node/Teaser View Formatting&lt;/dt&gt;
&lt;dd&gt;The Node and Teaser View types use the &quot;native&quot; formatting of the nodes being displayed. Data in these views are themed via the node templates of the nodes being displayed. e.g., node.tpl.php&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2&gt;default views list output&lt;/h2&gt;
&lt;p&gt;Views outputs list views as a series of divs and an unordered list. These allow you to use css selectors to target all views and fields on your site, or just the specific views and fields in the specific view you&#039;re working on. It&#039;s possible to quite radically alter how list views appear just by carefully targeting css at the various elements.&lt;/p&gt;
&lt;p&gt;For the purposes of this example, we&#039;ll use a list view called &quot;example_list&quot; using the following fields, and assuming it&#039;s displaying as a page:&lt;/p&gt;
&lt;p&gt;Image (from imagefield/cck, we&#039;ll call our image field &quot;field_photo&quot;)&lt;br /&gt;
node title (as link)&lt;/p&gt;
&lt;p&gt;Viewing the page source of your view will show the structure of your view, it begins with:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;view view-example-list&amp;quot;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;This gives you the css selectors .view and .view-example-list. Applying styles to .view will affect all views site-wide, applying styles to .view-example-list affects just our example_list view. Just about every div in a list view contains two classes in this format - one for every view (or field), and one for the specific view or field you&#039;re working with.&lt;/p&gt;
&lt;p&gt;If your view has a header, the next thing you&#039;ll see is:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;view-header view-header-example-list&amp;quot;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;.view-header will select every header in every view, .view-header-example-list will... hopefully you get that bit by now.&lt;/p&gt;
&lt;p&gt;Then we get to:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;view-content view-content-example-list&amp;quot;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;which follows the same format.&lt;/p&gt;
&lt;p&gt;Within view-content we get the list itself. It&#039;s at this point where the fields you selected when creating the view actually get output in an unordered list. The unordered list, the entire result set, and each individual field all get wrapped in divs for easy css selection.&lt;/p&gt;
&lt;p&gt;In our example, all of this code appears just before the &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;div class=&amp;quot;item-list&amp;quot;&amp;gt;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&amp;lt;div class=&amp;#039;view-item view-item-example-list&amp;#039;&amp;gt;&amp;lt;div class=&amp;#039;view-field view-data-node-data-field-photo-field-photo-fid&amp;#039;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;Looks confusing doesn&#039;t it? Well it&#039;s not so bad.&lt;/p&gt;
&lt;p&gt;.item-list wraps the unordered list, this allows any styles for .item-list in your theme to be overridden by .view .item-list&lt;/p&gt;
&lt;p&gt;Then an unordered list wraps all the results, with each row (usually node) appearing as a list item (within one set of &lt;code&gt;&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&lt;/code&gt; tags.)&lt;/p&gt;
&lt;p&gt;Often, you&#039;ll want to remove bullet points from unordered lists in views, you can do this using:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;.view-example-list ul li {&lt;br /&gt;&amp;nbsp; list-style-image: none;&lt;br /&gt;&amp;nbsp; list-style-type: none;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;Each row of results also gets enclosed in a div as well as the unordered list:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;div class=&amp;#039;view-item view-item-example-list&amp;#039;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;At this point, we get to the very first field output by your view, since field_photo was at the top of our field selection, it gets printed first:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;div class=&amp;#039;view-field view-data-node-data-field-photo-field-photo-fid&amp;#039;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;At this point views stops outputting classes for .all-views .your-view, and switches to .all-fields .your-field. This allows you to define the behaviour of fields across a number of different views, for example floating an imagefield left in any list view on your site.&lt;/p&gt;
&lt;p&gt;To do this, we could use&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;.view-data-node-data-field-photo-field-photo-fid img {&lt;br /&gt;float: left;&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;Or to float the image left in our example view, but leave it unaffected everywhere else, we could use:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;.view-example-list .view-data-node-data-field-photo-field-photo-fid img&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;or just&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;.view-example-list img&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;if there&#039;s just the one image field.&lt;/p&gt;
&lt;p&gt;The next set of code is for the node title:&lt;br /&gt;
&lt;code&gt;&amp;lt;div class=&amp;#039;view-field view-data-node-title&amp;#039;&amp;gt;&lt;/code&gt;&lt;br /&gt;
Note that .view-field is repeated, applying to any field of whatever type, and that .view-data-node-title applies to all instances of node-title.&lt;/p&gt;
&lt;p&gt;By now, you should have an understanding of what each set of divs represents, and how to target css at individual fields.&lt;/p&gt;
&lt;p&gt;If you want to theme your page view one way, and blocks slightly differently, you can add .block to any of the above selectors (i.e. &lt;code&gt;.block .view .item-list&lt;/code&gt;) assuming your block.tpl.php uses &lt;code&gt;&amp;lt;div class=&amp;quot;block&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt; to wrap blocks.&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/4161#comments</comments>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Mon, 21 May 2007 19:49:35 +0000</pubDate>
 <dc:creator>merlinofchaos</dc:creator>
 <guid isPermaLink="false">4161 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Do not show first item.</title>
 <link>http://groups.drupal.org/node/13917</link>
 <description>&lt;p&gt;I have created a view in Views 2 as an attachment, I don&#039;t want to show the first item. Is this possible?&lt;/p&gt;
&lt;p&gt;My use case is the home page of &lt;a href=&quot;http://www.millwoodonline.co.uk&quot; title=&quot;http://www.millwoodonline.co.uk&quot;&gt;http://www.millwoodonline.co.uk&lt;/a&gt; (sorry about the theme, it&#039;s a rough draft)&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/13917#comments</comments>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Tue, 12 Aug 2008 14:38:22 +0000</pubDate>
 <dc:creator>timmillwood</dc:creator>
 <guid isPermaLink="false">13917 at http://groups.drupal.org</guid>
</item>
<item>
 <title>List View Without the List? Simple View for d5!</title>
 <link>http://groups.drupal.org/node/13909</link>
 <description>&lt;p&gt;How hard would it be to make a view that was like the list view, but instead of&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;ul&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;we simply do&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;div id=&amp;quot;xxx1&amp;quot; class=&amp;quot;xxx&amp;quot;&amp;gt;&amp;lt;div id=&amp;quot;xxx1-1&amp;quot; class=&amp;quot;xxx&amp;quot;&amp;gt;data&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;?&lt;/code&gt;&lt;/div&gt;
&lt;p&gt;Im going to TRY and do this, its a Simple View!  This would be an excellent learning tool for both v1 and v2, since it would be a simple module that does one simple task!  But honestly I have no Idea how to start!&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/13909#comments</comments>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Tue, 12 Aug 2008 06:41:18 +0000</pubDate>
 <dc:creator>mgparisi@drupal.org</dc:creator>
 <guid isPermaLink="false">13909 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Advanced search form</title>
 <link>http://groups.drupal.org/node/13218</link>
 <description>&lt;p&gt;Another common need I think :&lt;/p&gt;
&lt;p&gt;Lot of us have a View page that list CCK nodes and which have exposed search filters. Don&#039;t you ?&lt;/p&gt;
&lt;p&gt;But which filters to expose if they are many ?&lt;/p&gt;
&lt;p&gt;Maybe it can be a good idea if we can set that some exposed filters are available in a kind of &quot;group field set&quot; for more advanced research or even on a separate &quot;advanced search&quot; page.&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/13218#comments</comments>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Wed, 16 Jul 2008 15:21:16 +0000</pubDate>
 <dc:creator>Julien Marboutin</dc:creator>
 <guid isPermaLink="false">13218 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Create a view of taxonomy linking to something else (photogallery)</title>
 <link>http://groups.drupal.org/node/13067</link>
 <description>&lt;p&gt;Hello everybody,&lt;/p&gt;
&lt;p&gt;I followed the tutorial on drupal.org about creating a photogallery with cck, views, image_field etc.&lt;/p&gt;
&lt;p&gt;To have different photogalleries I set up different terms for the vocabulary &quot;Photogallery-v&quot;.&lt;br /&gt;
Each terms is associated to an image trought the module &quot;taxonomy image&quot;.&lt;/p&gt;
&lt;p&gt;I created the views for the single galleries (actually is a parametric view) in the form /photogallery/&lt;/p&gt;
&lt;p&gt;Now, i would like to create a block-page-something that will list the last galleries on the site, showing up the taxonomy associated image.&lt;/p&gt;
&lt;p&gt;I tried to create a view of taxonomy. But there&#039;s a small problem.&lt;/p&gt;
&lt;p&gt;How can I link the taxonomy link on the block to the photogallery view?&lt;/p&gt;
&lt;p&gt;Thanks folks,&lt;br /&gt;
Fabio&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/13067#comments</comments>
 <category domain="http://groups.drupal.org/taxonomy/term/5701">views image_field</category>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Thu, 10 Jul 2008 14:04:59 +0000</pubDate>
 <dc:creator>alexic@drupal.org</dc:creator>
 <guid isPermaLink="false">13067 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Search agent </title>
 <link>http://groups.drupal.org/node/13029</link>
 <description>&lt;p&gt;Have you ever used a search agent on a job market site for example ?&lt;/p&gt;
&lt;p&gt;As a user, you can define key words and be alerted by email when new contents that match your criterias appear on the site.&lt;/p&gt;
&lt;p&gt;Is there people working on a kind of general search agent working with CCK and Views ?&lt;/p&gt;
&lt;p&gt;Please let me know if you are working on this or if you would like to work on this because I know someone that is willing to pay for this functionnality this summer for a site working with Drupal 5 and Views.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Ps : do you think it will be easy to develop it both for drupal 6 and 5 ?&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/13029#comments</comments>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Wed, 09 Jul 2008 09:52:02 +0000</pubDate>
 <dc:creator>Julien Marboutin</dc:creator>
 <guid isPermaLink="false">13029 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Trouble creating a custom sort function for a CCK type</title>
 <link>http://groups.drupal.org/node/13017</link>
 <description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&#039;m trying to figure out the best way to use the Views (v1.x) API to create a custom sort function for a CCK type.&lt;/p&gt;
&lt;p&gt;Here&#039;s what I have:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CCK fields:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;title (string)&lt;/li&gt;
&lt;li&gt;rating_a (int)&lt;/li&gt;
&lt;li&gt;rating_b (int)&lt;/li&gt;
&lt;li&gt;rating_c (int)&lt;/li&gt;
&lt;li&gt;rating_d (int)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I need to develop a way to sort the view by the average of a variable number of the &quot;rating&quot; CCK fields.&lt;/p&gt;
&lt;p&gt;For example, if the user wants to sort the nodes only by &quot;rating_a&quot; and &quot;rating_c&quot;, then the &quot;order by&quot; clause would look something like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;...ORDER BY (rating_a + rating_c)/2 DESC&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Or, if the user wants to sort the nodes by &quot;rating_b&quot;, &quot;rating_c&quot;, and &quot;rating_d&quot;, the order clause would look like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;...ORDER BY (rating_b + rating_c + rating_d)/3 DESC&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Make sense so far?&lt;/p&gt;
&lt;p&gt;The various &quot;rating_*&quot; choices will be coming in via arguments in the form &quot;rating_a+rating_b+rating_c&quot;. So far, my plan has been to hook_views_arguments to define the argument, then to write a custom handler. In the custom handler, I&#039;m planning on using $query-&amp;gt;add_orderby() in the &quot;filter&quot; $op to actually add the sort criteria.&lt;/p&gt;
&lt;p&gt;The problem I&#039;m having is that I&#039;m not sure what to set the add_orderby() parameters to:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;add_orderby($table, $field, $order, $alias = &amp;#039;&amp;#039;)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;When I look at the $query coming into the custom handler, I don&#039;t see any of the CCK tables joined. I know that at some point the CCK tables will be there, but it seems that when my module&#039;s hooks are called, the CCK stuff hasn&#039;t been added yet.&lt;/p&gt;
&lt;p&gt;Am I taking the correct approach on this or am I going about this the wrong way? Any help would be appreciated.&lt;/p&gt;
&lt;p&gt;Here&#039;s a (simplified) copy of the code:&lt;/p&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;/**&lt;br /&gt; * Implementation of hook_views_arguments.&lt;br /&gt; */&lt;br /&gt;function mymodule_views_arguments() {&lt;br /&gt;&amp;nbsp; $arguments = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039;ratings&amp;#039; =&amp;gt; array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039;name&amp;#039; =&amp;gt; t(&amp;#039;Ratings&amp;#039;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039;handler&amp;#039; =&amp;gt; &amp;#039;mymodule_views_handler_rating&amp;#039;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#039;help&amp;#039; =&amp;gt; t(&amp;#039;This argument sorts the results based on the ratings inputs.&amp;#039;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),&lt;br /&gt;&amp;nbsp; );&lt;br /&gt;&amp;nbsp; return $arguments;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;/**&lt;br /&gt; * Implementation of hook_views_handler_arguement.&lt;br /&gt; */&lt;br /&gt;function mymodule_views_handler_rating($op, &amp;amp;$query, $a1, $a2 = null) {&lt;br /&gt;&amp;nbsp; switch ($op) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; case &amp;#039;filter&amp;#039;:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dsm($query);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //$query-&amp;gt;add_orderby($table, $field, $order, $alias = &amp;#039;&amp;#039;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/13017#comments</comments>
 <category domain="http://groups.drupal.org/taxonomy/term/108">CCK</category>
 <category domain="http://groups.drupal.org/taxonomy/term/5688">sorting</category>
 <category domain="http://groups.drupal.org/taxonomy/term/100">views</category>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Tue, 08 Jul 2008 19:56:04 +0000</pubDate>
 <dc:creator>ultimike@drupal.org</dc:creator>
 <guid isPermaLink="false">13017 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Creating template for fields in colums</title>
 <link>http://groups.drupal.org/node/12977</link>
 <description>&lt;p&gt;Hi all,&lt;br /&gt;
tried to figure out how to create a template to publish fields in different colums.&lt;br /&gt;
For each row there are several fields. Now I don&#039;t want to put them one after the other. Instead I want to put them in 3 colums. So it is a little bit like the already existing grid-view. But instead of displaying &quot;rows&quot; next by next I want to put fields in the colums.&lt;br /&gt;
Is there a way to do it?&lt;br /&gt;
Thought about creating my own template as a copy of the views-view-grid.tpl.php and putting the names of the fields in this directly. But did not work (as I don&#039;t know how to call the fields in a view).&lt;/p&gt;
&lt;p&gt;What do you suggest?&lt;br /&gt;
Regards&lt;/p&gt;
&lt;p&gt;Kai&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/12977#comments</comments>
 <category domain="http://groups.drupal.org/taxonomy/term/5665">views fields colums template</category>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Mon, 07 Jul 2008 16:19:12 +0000</pubDate>
 <dc:creator>vistree</dc:creator>
 <guid isPermaLink="false">12977 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Building a view from a different source (not Database)</title>
 <link>http://groups.drupal.org/node/12838</link>
 <description>&lt;p&gt;Hi, everyone!&lt;/p&gt;
&lt;p&gt;I&#039;m doing a GSoC project to improve the &lt;a href=&quot;http://drupal.org/project/apachesolr&quot;&gt;apachesolr module&lt;/a&gt; (&lt;a href=&quot;http://groups.drupal.org/node/10977&quot;&gt;See here for details&lt;/a&gt;). Core of the project is to find a way to create a view showing results from a Solr search query. And this is where I could use some ideas from people more experienced with Views than me.&lt;/p&gt;
&lt;p&gt;As you know, Views dynamically builds an SQL query which returns the objects to display. But since the Solr search data is not in the database, and also has no SQL interface, Views can&#039;t be easily used to display objects from this or similar sources.&lt;/p&gt;
&lt;p&gt;I&#039;ve already found (and published, see &lt;a href=&quot;http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/apachesolr/includes/apachesolr.views.inc?revision=1.1&amp;amp;view=markup&quot;&gt;apachesolr HEAD&lt;/a&gt;) one workaround: a filter which inserts Solr&#039;s search results as a &quot;WHERE node.nide IN (...)&quot; into the Views query. It should also be possible to change this to an argument, so it does not only work on the Solr search results page but also as an independent page, executing the query itself.&lt;br /&gt;
This approach still has some drawbacks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Views query as well as the Solr search have to be executed, decreasing performance.&lt;/li&gt;
&lt;li&gt;In the current state, adding additional filters to the view decreases the number of results displayed, since the apachesolr filter filters out exactly ten results (the actual number is configurable). It might even show no results at all, when there really would be some.&lt;br /&gt;
Currently, a workaround is to set the number of results displayed by Solr to a higher number than that of the view, but to completely remedy this one would have to use a Solr search without result limit, further dropping performance.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One idea from my mentor and maintainer of the apachesolr module would be to first execute the Views query and then pass the returned nids to the Solr query, but this would have the same problems as the current approach. Moreover, I think that because a search typically returns less nodes than most filters, the effects of the second problem will be far more pronounced this way, unless Solr is really good with such things. However, it remains to be tested.&lt;/p&gt;
&lt;p&gt;One other idea I&#039;ve got would be to create the view programmatically and replacing the call to $view-&amp;gt;execute() with an equivalent custom function. But then the problem would be that either that function would have to parse the SQL query (or at least make a good attempt) and translate it to one for Solr, or the view couldn&#039;t use any predefined filters. In the latter case, it would operate on a new fictional &quot;apachesolr&quot; base table, maybe with an own way to define filters.&lt;/p&gt;
&lt;p&gt;So, as you can see, all approaches I can think of have more or less serious flaws.&lt;br /&gt;
Which one would you use? Can you think of additional ones, or improvements to the existing? What are your thoughts on the whole subject? What advice do you have?&lt;/p&gt;
&lt;p&gt;Thanks in advance for your responses!&lt;/p&gt;
&lt;p&gt;PS: Oh, and this uses Views 2, before you ask.&lt;/p&gt;
&lt;div class=&quot;og_rss_groups&quot;&gt;&lt;a href=&quot;/views-developers&quot;&gt;Views Developers&lt;/a&gt;&lt;/div&gt;</description>
 <comments>http://groups.drupal.org/node/12838#comments</comments>
 <group domain="http://groups.drupal.org/views-developers">Views Developers</group>
 <pubDate>Tue, 01 Jul 2008 15:34:08 +0000</pubDate>
 <dc:creator>drunken monkey@drupal.org</dc:creator>
 <guid isPermaLink="false">12838 at http://groups.drupal.org</guid>
</item>
<item>
 <title>Views 2 RC release notes working post</title>
 <link>http://groups.drupal.org/node/12726</link>
 <description>&lt;p&gt;This is a wiki to try and get the community to help me out with the Views 2 RC announcement, which should be coming within days. Maybe hours. But probably days. This is cross-posted to Usability as suggested in #drupal IRC, as there are apparently folks that might help there.&lt;/p&gt;
&lt;p&gt;This announcement will be d.o front page, so it needs to be a good one. One of the things I&#039;m looking for here is a bullet point list of the new features in Views 2, something that I find very difficult to do, because my mind tends to freeze up when I need to make lists; especially since I&#039;ve been working on so much stuff it all tends to clutter up in my head when I have to start from 0 like this.&lt;/p&gt;
&lt;p&gt;Some points that need to be covered:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;This rewrite of the original post attempts to break down the new features into different types of users that will benefit most from the improvements&lt;/strong&gt;. It definitely needs fleshing out, particularly on the themers and developers section -- it would also benefit from screenshots (which I&#039;ll be glad to take, if needed). So, this needs additional work, but it&#039;s a start. ~billfitzgerald&lt;/p&gt;
&lt;p&gt;FYI this is a marketing doc. Taking out marketing language and replacing it with developer-centric language is not valuable. ~Merlin&lt;/p&gt;
&lt;p&gt;&lt;hr /&gt;&lt;/p&gt;
&lt;h2&gt;START OF ANNOUNCEMENT&lt;/h2&gt;
&lt;h2&gt;Views 2, CCK 2, and Organic Groups Release Candidates now available for Drupal 6!&lt;/h2&gt;
&lt;p&gt;We are excited to announce that three key modules, Views, CCK, and Organic Groups, are publishing release candidates for Drupal 6. If you are interested in speeding the transition to a full release, &lt;strong&gt;install and test the Release Candidates (RC)&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;http://drupal.org/project/views&quot;&gt;Views 2&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The Views module has undergone extensive development, refactoring, and testing.  Views2 improves the existing functionality of the Views module, and adds new features designed to simplify life for developers, site admins, themers, and end users alike.&lt;/p&gt;
&lt;h3&gt;New Features for end users&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Multiple blocks, pages, and feeds per view.&lt;/li&gt;
&lt;li&gt;Built-in AJAX for pagers, exposed filters, and argument drilldown clicks. Great in blocks!&lt;/li&gt;
&lt;li&gt;RSS feeds for comments.&lt;/li&gt;
&lt;li&gt;Greater control over exposed filters, including being able to reduce a taxonomy list to just terms you select&lt;/li&gt;
&lt;li&gt;Can have multiple &quot;displays&quot; on a view with the same path, which have different features -- give your administrators and privileged users richer views than others!&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;New Features for themers&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;generates the theming information needed to customize your views through templates&lt;/li&gt;
&lt;li&gt;all views output is done through templates, dramatically improving theme; the old theme wizard is no longer necessary.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;do we want to link&lt;/strong&gt; to the &lt;a href=&quot;http://groups.drupal.org/node/4161&quot;&gt;theming documentation page&lt;/a&gt; here?&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;New Features for site admins&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://groups.drupal.org/files/20080628-e81jka9qmsehfjrjwc54whtmct.jpg&quot;&gt;&lt;img src=&quot;http://groups.drupal.org/files/20080628-e81jka9qmsehfjrjwc54whtmct-small.png&quot; align=&quot;right&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A completely reworked UI for creating and maintaining views. Features of the UI include:
&lt;ul&gt;
&lt;li&gt;Options are presented based on context; thus, when editing/creating a view, you are presented with only the options you need.&lt;/li&gt;
&lt;li&gt;If 2 people are editing the same View the view will be locked; only one person can edit a view at a time.&lt;/li&gt;
&lt;li&gt;Live preview! Make a change, scroll down and see what your view looks like.&lt;/li&gt;
&lt;li&gt;Upon previewing, performance timers show how long your View took to build, query, and render. Great for quick performance tuning.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Views can pull data from many different core tables. Users, comments, statistics, files, plus other things can be plugged.&lt;/li&gt;
&lt;li&gt;Can have views within views, known as attachments.&lt;/li&gt;
&lt;li&gt;&quot;View type&quot; is now called &#039;style&#039; and has split into style and row style; these are far more flexible. We&#039;ve also added useful styles such as &lt;em&gt;grouping&lt;/em&gt; and &lt;em&gt;grid&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Lots inline help with the &lt;a href=&quot;http://drupal.org/project/advanced_help&quot;&gt;Advanced Help&lt;/a&gt; module.&lt;/li&gt;
&lt;li&gt;New relationships can let you have all the fields from referenced nodes right in your view.&lt;/li&gt;
&lt;li&gt;New glossary styles make it easy to have the &#039;alpha pagers&#039;&lt;/li&gt;
&lt;li&gt;Pluggable mechanism to find values for arguments for blocks -- easily create views for the node or user page with no PHP snippets required&lt;/li&gt;
&lt;li&gt;Views now have optional tags in addition to names; allowing you to sort your list of views and find and edit the ones for which you&#039;re looking.&lt;/li&gt;
&lt;li&gt;Export multiple Views at once.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;New Features for developers&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Reworked, pluggable object-oriented API. Every component of Views is implemented as plugin objects and handlers. Views developers now have a great deal of freedom extending and customizing Views with their own data tables, display types, and view and row style plugins.&lt;/li&gt;
&lt;li&gt;Tool to analyze your view for common mistakes (that can be expanded through plugins)&lt;/li&gt;
&lt;li&gt;Pluggable argument validation (can embed PHP code) to give you greater control over what kind of arguments your views can use&lt;/li&gt;
&lt;li&gt;The SQL statements used to generate a view are displayed on preview&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;do we want to link&lt;/strong&gt; to the &lt;a href=&quot;http://groups.drupal.org/node/10129&quot;&gt;Views2 documentation page&lt;/a&gt; here? (probably not, primary Views2 doc will now live in advanced help bundled with the module. -- Merlin)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Technical details, and known bugs&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
There are a couple of bugs in Drupal 6.2 that are fixed in Drupal 6.x-dev that make it very important that Drupal 6.3 is used (or, since that is not currently available, Drupal 6.x-dev).
&lt;/li&gt;
&lt;li&gt;
If you find yourself having troubles with the javascript (there are a few people who report problems that we can&#039;t figure out yet) the javascript part can be completely turned off and the UI largely works without javascript, though a couple of places (arguments, in particular) may be a little rough.
&lt;/li&gt;
&lt;li&gt;
The upgrade path from 1 to 2 is going to take some manual work to convert your Views to the new format. Views2 contains a Views1 conversion tool, but existing views will likely need some additional work to function in Views2
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In using and testing the Release Candidate, if you find what appears to be a bug, &lt;a href=&quot;http://drupal.org/project/issues/views&quot;&gt;browse&lt;/a&gt; and/or &lt;a href=&quot;http://drupal.org/project/issues/search/views&quot;&gt;search&lt;/a&gt; the issue queue to see if someone else has reported a similar issue. If you have found something new, please &lt;a href=&quot;http://drupal.org/node/add/project-issue/views&quot;&gt;file a new issue&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;http://drupal.org/project/cck&quot;&gt;Content Construction Kit  - CCK 2&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;CCK has been significantly reworked for Drupal 6, both to add new functionality and to integrate into the new Views 2 code.&lt;/p&gt;
&lt;h3&gt;New Features&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;New ajax &#039;Add more&#039; button that the user can click as many times as they like to add the right number of values for multiple value fields. &lt;/li&gt;
&lt;li&gt;The Manage Fields screen now uses drag &#039;n drop to make it easy to re-organize fields and fieldgroups.&lt;/li&gt;
&lt;li&gt;The Manage Fields screen now lets you re-arrange non-CCK &quot;fields&quot;, like the title and body, as well as CCK fields. A hook is available for modules that want to have their own node form elements benefit from this.&lt;/li&gt;
&lt;li&gt;Numerous usability improvements have been incorporated based on feedback from the usability testing at the University of Minnesota.&lt;/li&gt;
&lt;li&gt;A new API has been added to make it easier to create and populate fields from custom modules and profiles.&lt;/li&gt;
&lt;li&gt;A new Content Permissions module included in the CCK package lets you control access to individual fields.&lt;/li&gt;
&lt;li&gt;CCK now integrates with the Devel Generate module. Core CCK fields and any other CCK field that implements the content_generate() hook will add random valid field values to the generated nodes.&lt;/li&gt;
&lt;li&gt;New formatters can format either a single field value or all the multiple values of a field. Custom modules could use this to display field values in a map or chart.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;CCK / Views 2 Integration&lt;/h3&gt;
&lt;p&gt;As always, CCK has automatic, built-in Views integration for all CCK fields.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add a &#039;relationship&#039; to a view using a nodereference or userreference field, then add any field, sort, filter, or argument from the referenced node or user to the view (just indicate it is coming from the relationship instead of the original node).&lt;/li&gt;
&lt;li&gt;Views filters now include &#039;empty/not empty&#039; options.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Known Problems and Bugs&lt;/h3&gt;
&lt;h4&gt;Upgrade from D5&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Many of the older updates have been removed from the code, so you need to get current on the D5 version before upgrading to the D6 version, or you may get messages about missing updates. &lt;/li&gt;
&lt;li&gt;There are still some sporadic upgrade problems.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So &lt;em&gt;please&lt;/em&gt; be sure to make a backup copy of your database before upgrading to the D6 version.&lt;/p&gt;
&lt;h2&gt;&lt;a href=&quot;http://drupal.org/project/og&quot;&gt;Organic Groups&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Compared to Views and CCK, Organic groups received less of an overhaul for Drupal 6. Most of the changes are straightforward improvements which take advantage of new features in core and Views. A few major highlights:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Member listings powered by Views. Anytime you want to list the members of group(s), you may use standard Views user listings to do so. So you can now list all members who have a given profile field or all members who are group admins and so on. All the power you are used to for making lists of group nodes and group posts now extends to users. For example, the Faces tab in each group is now powered by a View which uses the &#039;grid&#039; style.&lt;/li&gt;
&lt;li&gt;More Views fields such as the number of members and posts in a given group.&lt;/li&gt;
&lt;li&gt;The current group (if any) is exposed to javascript code. This means you can easily target advertisements or track analytics by organic group.&lt;/li&gt;
&lt;li&gt;Theming groups has become easier as we now ship a template which is for all groups by defau