Drupal:视图,视图可以显示不同的样式吗? [英] Drupal: Views, can the displays have different styles for the view?

查看:86
本文介绍了Drupal:视图,视图可以显示不同的样式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的视图创建了几个显示。

I've created several displays for my View.

我以为我可以为每个显示器分配不同的样式(图库,表等)我意识到只有1个样式用于所有显示。

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.

THanks

推荐答案

他们可以。

请参阅 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 and views-view--alpha--block.tpl.php, for instance, would control those two types of displays for the alpha view.

文件 views-view - page.tpl.php 将用page
显示控制所有视图。

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 将覆盖
alpha视图的显示。

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.

http://drupal.org/node/209561

您提到了一个列表(未格式化)和一个表。您将主题使用以下文件:

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 覆盖该视图的表视图。 / li>
  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆