视图中的主题化,drupal 7

发布于 2024-12-26 13:39:51 字数 768 浏览 2 评论 0原文

目标:为字段添加 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

掩于岁月 2025-01-02 13:39:51

正确的模板文件是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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文