问题
I need to alter the output of a view that displays in a in a block in order to apply it to some format of a Jquery UI script so I need the following format for a grouped taxonomy query that I'va configured for some node type..
<div id="tab">
<ul>
<li><a href="#tabs-1">Tab1Title</a></li>
<li><a href="#tabs-2">Tab2Title</a></li>
<li><a href="#tabs-3">Tab3Title</a></li>
</ul>
</div>
<div id="tabs-1">Content2</div>
<div id="tabs-2">Content2</div>
<div id="tabs-3">Content3</div>
回答1:
You need to create a Style Plugin, and expose it to views 2 API.
A complete style plugin is made up of these components:
- An implementation of hook_views_api so Views will load your include files;
- An implementation of hook_views_plugins to declare your style plugin;
- An implementation of the views_plugin_style class;
- A theme preprocess function for your style theme;
- A theme .tpl.php page.
Here is good reference about extending views 2 with custom modules (from which I taken this component list): http://groups.drupal.org/node/10129
回答2:
You need to create your own views style-plugin. Look at views_plugin_style_default.inc in your views module folder.
Then go to Style plugins and find out more about how to implement a style plugin from your own module.
You basically implement the hook_views_style_plugins() and then create your own class that extends views_plugin_style.
Best of luck!
来源:https://stackoverflow.com/questions/4888040/how-to-create-custom-style-output-in-views-in-drupal-6-besides-grid-table-ht