我不确定如何让视图以我想要的方式显示
我正在使用自定义主题。
我有一个带有两个字段的自定义内容类型。
- 标题
- 缩略图(使用 imagecache 创建)
请注意,在下面的示例中,URL 1 和标题 1 是结果集中第一行的两个字段。
我希望它输出类似这样的内容:
<span>
<img src="URL1" />
<span>Title 1</span>
</span>
<span>
<img src="URL2" />
<span>Title 2</span>
</span>
基本上,我使用了一个彼此齐平的块的水平列表。每个块由两部分组成,顶部是缩略图,底部是标题。
我遇到的问题是我不确定应该使用哪个主题覆盖。在这种情况下,每个列表元素由两个字段组成,而不是视图模块似乎期望的每个字段 1 个列表元素。覆盖字段太低,但覆盖行似乎太高,因为我似乎无法获取我需要的信息。
您建议我如何实现这一目标?
I'm using a custom theme.
I have a custom content type with two fields.
- title
- thumbnail (created using imagecache)
Note, in the example below, URL 1 and Title 1 are the two fields for the first row in the result set.
I would like it to output something like so:
<span>
<img src="URL1" />
<span>Title 1</span>
</span>
<span>
<img src="URL2" />
<span>Title 2</span>
</span>
Basically I went a horizontal list of blocks that are flush with each other. Each block consists of two parts, the top part is a thumbnail, the bottom part is the title.
The issue I'm having is that I'm not sure which theme override I should use. In this case each list element consists of two fields rather than the 1 list element per field that the views module seems to expect. Overriding fields is too low, but overriding the rows seems to be too high because I can't seem to get at the information I need.
How would you recommend I go about accomplishing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用视图,则可以在不覆盖主题的情况下操纵显示。
为此,首先确保安装了图片库模块。然后,从 /admin 进入站点建设 ->意见。在列表中找到您的视图,然后单击其编辑链接。此时,如果不存在,您可能需要为此特定视图添加额外的显示,或者仅保留默认显示。单击“基本设置”部分下的“样式类型”,然后选择“图库”。
我没有尝试过这个,但它应该有效。
If you are using Views, you have the ability to manipulate the display without overriding the theme.
To do this, first ensure that the image gallery module is installed. Then, from /admin go to Site Building -> Views. Find your view in the list and click it's edit link. At this point if one doesn't exist, you may want to add an additional display for this specific view, or just stick with the default display. Click on the Style type under the Basic Settings section and choose Gallery.
I haven't tried this, but it should work.