视图中的主题化,drupal 7
目标:为字段添加 div 包装器,以便对每个结果的字段进行分组。
因此视图将所有结果显示为字段,我需要根据每个结果对其进行主题化。因此,每个结果都会有名称、图像...。
您可以在此处查看当前结果视图:http://www.iamvishal.com/dev/prosearch/%20/%20/%20/%20/%20
我尝试使用它来主题化views-view-unformatted.tpl.php 文件,但它不会做任何事情。我确实更改了 tpl 以适合我的视图,例如views-view-unformatted--properityresults--page.tpl.php。
这是行不通的。有任何线索出了什么问题吗?
下面是代码:
<?php if (!empty($title)): ?>
<h3><?php print $title; ?></h3>
<?php endif; ?>
<?php foreach ($rows as $id => $row): ?>
<div class="<?php print $classes_array[$id]; ?>">
<?php print $row; ?>
</div>
<?php endforeach; ?>
Goal : To add a div wrapper for the fields so as to group the fields per result.
So views is displaying all the results as fields and I need to theme it as per each result. So each result will have the name, image ....
You can see the current results view here : http://www.iamvishal.com/dev/prosearch/%20/%20/%20/%20/%20
I tried to theme it using views-view-unformatted.tpl.php file but It won't do anything. I did change the tpl to suit my view such as views-view-unformatted--properityresults--page.tpl.php.
It won't work. Any clues what is going wrong ?
Below is the code:
<?php if (!empty($title)): ?>
<h3><?php print $title; ?></h3>
<?php endif; ?>
<?php foreach ($rows as $id => $row): ?>
<div class="<?php print $classes_array[$id]; ?>">
<?php print $row; ?>
</div>
<?php endforeach; ?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确的模板文件是views-view--properityresults--page.tpl.php
,而不是views-view-unformatted--properityresults--page.tpl.php。
干杯,
Vishal
我将根据系统设置在一天后标记为已解决。
The correct template file was views-view--properityresults--page.tpl.php
and not views-view-unformatted--properityresults--page.tpl.php.
cheers,
Vishal
I will mark is solved after a day as per the system settings.