【发布时间】:2011-06-22 08:03:01
【问题描述】:
我试图在主页上创建一个所有节点的网格视图,该视图迭代了 3 种不同的模板模式,因此我可以为每个传递到视图的节点设置不同的图像缓存预设。 我使用 page-front.tpl.php 进行家居设计,目前有一个模板预处理指向 node-front.tpl.php。
我想真正实现这一点的唯一方法是在模板预处理中?
所以我希望代码能让我能够为模式中的 3 个交替节点中的每一个分配不同的图像缓存预设,例如:
for node "1", display template pattern "1" with imagecache preset "big-image".
for node "2", display template pattern "2" with imagecache preset "tall-image".
for node "3", display template pattern "3" with imagecache preset "small-image".
for node "4", display template pattern "1" with imagecache preset "big-image".
for node "5", display template pattern "2" with imagecache preset "tall-image".
for node "6", display template pattern "3" with imagecache preset "small-image".
等等
那里有任何 Drupal 专家愿意试一试吗?
【问题讨论】:
标签: php templates drupal themes preprocessor