如何在Drupal 6的视图中创建自定义样式输出?除了Grid,Table,HTML列表? [英] How to create custom Style output in views in Drupal 6 ? besides Grid, Table, HTML list?
问题描述
我需要改变在块中显示的视图的输出,以便将其应用于某种格式的Jquery UI脚本,因此我需要以下格式为分组的分类查询I'va配置为一些节点类型..
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>
推荐答案
您需要创建一个Style Plugin, to views 2 API。
You need to create a Style Plugin, and expose it to views 2 API.
完整的样式插件由以下组件组成:
A complete style plugin is made up of these components:
- hook_views_api 的实施,因此视图将加载您的包含
文件; - hook_views_plugins的实现声明您的样式
插件; - 实施 views_plugin_style class;
- 您的风格主题的主题预处理功能;
- 主题.tpl .php页面。
- 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.
这是关于使用自定义模块扩展视图2的好参考$ b http://groups.drupal.org/node/10129
Here is good reference about extending views 2 with custom modules (from which I taken this component list): http://groups.drupal.org/node/10129
这篇关于如何在Drupal 6的视图中创建自定义样式输出?除了Grid,Table,HTML列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!