Drupal如何使视图显示为列而不是行

时间:2022-08-27 18:17:15

I am trying to get a drupal 6 view to display in a column format rather than rows. Basically I want to group my pictures/video by taxonomy and display them in a table. Similar to what I have below. I tried enabling grouping with a grid layout but that did not seem to do it.

我试图让drupal 6视图以列格式而不是行显示。基本上我想按分类法对照片/视频进行分组并将它们显示在表格中。类似于我在下面的内容。我尝试使用网格布局启用分组,但似乎没有这样做。

Cows Horses Dogs Cats
Picture Picture Picture Picture
Picture Picture Picture Picture
Picture Picture Picture Picture
Picture Picture Picture Picture
Picture Picture Picture Picture

奶牛狗狗猫图片图片图片图片图片图片图片图片图片图片图片图片图片图片图片图片图片图片图片

Hope this makes sense.

希望这是有道理的。

4 个解决方案

#1


If you're using Views 2, one way would be to create a table view, then use a custom views-view-your-view-name.tpl.php file to output the columns and rows vertically rather than horizontally. That template override gets the rows and columns as arrays of objects that you can output however you'd like.

如果您正在使用视图2,一种方法是创建表视图,然后使用自定义views-view-your-view-name.tpl.php文件垂直输出列和行而不是水平输出。该模板覆盖将行和列作为对象数组获取,您可以输出它们。

#2


I don't think Panels are good answer to this question, the have different purpose.

我不认为小组对这个问题有好的答案,有不同的目的。

I would maybe use a view which is sorted by custom parameter in URL, set output as list (so it is li div.title Title, div.date Date, div image Image /li etc), and style the list with css (.li has fixed size and float:left;).

我可能会使用一个视图,该视图按URL中的自定义参数排序,将输出设置为列表(因此它是li div.title Title,div.date Date,div image Image / li等),并使用css(。 li有固定的大小和float:left;)。

Then I would a "sort by" selector before view (there is a field for HTML that will be repeated before any view output - [a href="?sort=Name"]Sort by name[/a])

然后我会在视图之前选择“排序依据”选择器(在任何视图输出之前有一个HTML字段将重复 - [a href =“?sort = Name”]按名称排序[/ a])

#3


You might be able to use multiple views and panels. Check out the panels module

您可以使用多个视图和面板。检查面板模块

#4


The Flipped Table add-on is part of the Views Hacks module.

Flipped Table附加组件是Views Hacks模块的一部分。

#1


If you're using Views 2, one way would be to create a table view, then use a custom views-view-your-view-name.tpl.php file to output the columns and rows vertically rather than horizontally. That template override gets the rows and columns as arrays of objects that you can output however you'd like.

如果您正在使用视图2,一种方法是创建表视图,然后使用自定义views-view-your-view-name.tpl.php文件垂直输出列和行而不是水平输出。该模板覆盖将行和列作为对象数组获取,您可以输出它们。

#2


I don't think Panels are good answer to this question, the have different purpose.

我不认为小组对这个问题有好的答案,有不同的目的。

I would maybe use a view which is sorted by custom parameter in URL, set output as list (so it is li div.title Title, div.date Date, div image Image /li etc), and style the list with css (.li has fixed size and float:left;).

我可能会使用一个视图,该视图按URL中的自定义参数排序,将输出设置为列表(因此它是li div.title Title,div.date Date,div image Image / li等),并使用css(。 li有固定的大小和float:left;)。

Then I would a "sort by" selector before view (there is a field for HTML that will be repeated before any view output - [a href="?sort=Name"]Sort by name[/a])

然后我会在视图之前选择“排序依据”选择器(在任何视图输出之前有一个HTML字段将重复 - [a href =“?sort = Name”]按名称排序[/ a])

#3


You might be able to use multiple views and panels. Check out the panels module

您可以使用多个视图和面板。检查面板模块

#4


The Flipped Table add-on is part of the Views Hacks module.

Flipped Table附加组件是Views Hacks模块的一部分。