Drupal: Views, can the displays have different styles for the view?

前端 未结 1 1196
梦毁少年i
梦毁少年i 2021-01-28 03:35

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

相关标签:
1条回答
  • 2021-01-28 04:39

    They can.

    See http://drupal.org/node/352970

    The idea is to use specific names for template files, also called template-suggestions. Some examples are:

    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.

    The file views-view--page.tpl.php would control all views with a "page" display.

    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.

    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 (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.
    0 讨论(0)
提交回复
热议问题