Drupal:视图,视图的显示可以有不同的样式吗? [英] Drupal: Views, can the displays have different styles for the view?
问题描述
我为我的视图创建了多个显示.
I've created several displays for my View.
我以为我可以为每个显示分配不同的视图样式(图库、表格等),但我意识到所有显示只使用一种样式.
I thought that I could assign different styles (Gallery, Table, etc) of the view for each display but I realized that only 1 Style is used for all Displays.
我想改变的原因是因为我正在使用 DraggableViews,并且当用户使用可拖动节点在显示器上拖动某些项目时,我希望对所有显示保持相同的顺序.
The reason I wanted to change is because I'm using DraggableViews, and I would like to keep the same order for all displays, when the user drag some items on the display with draggable nodes.
谢谢
推荐答案
他们可以.
参见 http://drupal.org/node/352970
这个想法是为模板文件使用特定的名称,也称为模板建议.一些例子是:
The idea is to use specific names for template files, also called template-suggestions. Some examples are:
文件 views-view--alpha--page.tpl.php
和例如,views-view--alpha--block.tpl.php
会控制那些alpha 视图的两种显示方式.
The files
views-view--alpha--page.tpl.php
andviews-view--alpha--block.tpl.php
, for instance, would control those two types of displays for the alpha view.
文件 views-view--page.tpl.php
将控制所有带有页面"的视图展示.
The file views-view--page.tpl.php
would control all views with a "page"
display.
文件 views-view--page-1.tpl.php
将控制显示在所有视图的第一页上(对于那些使用寻呼机的人),而views-view--alpha--page-1.tpl.php
将覆盖该显示阿尔法视图.
The file views-view--page-1.tpl.php
would control the display
on the first page of all views (for those that use a pager), while
views-view--alpha--page-1.tpl.php
would override that display for the
alpha view.
如果您需要更多模板建议,请查看主题开发人员.这有点类似于 Firebug,但允许搜索各种模板建议和主题功能命名文档;您点击页面中的一个项目,它会显示要使用哪些名称和文件来覆盖.
If you want more template suggestions, check out the Theme Developer. that resembles somewhat the Firebug, but allows searching for all kinds of template suggestions and theme-function naming documentation; you click on an item in your page and it shows you what names and files to use to override.
您提到了一个列表(未格式化)和一个表格.您将使用以下文件主题:
You mentioned a list (unformatted) and a table. You will theme that, using the following files:
views-view--list.tpl.php
(通过任何视图覆盖所有列表)views-view--table.tpl.php
(通过任何视图覆盖所有表)views-view--YourViewName-table.tpl.php
覆盖该视图的表视图.
views-view--list.tpl.php
(overrides all lists by any view)views-view--table.tpl.php
(overrides all tables by any view)views-view--YourViewName-table.tpl.php
overrides the table view for that view.
这篇关于Drupal:视图,视图的显示可以有不同的样式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!