我是 Drupal 7 的新手,想知道如何在我的自定义字段主题中获取图像路径。
我的主题文件夹中的字段--field_image_flow.tpl.php 文件中有以下内容:
<div id="Products" class="ContentFlow" style="overflow: visible;">
<!-- should be place before flow so that contained images will be loaded first -->
<div class="loadIndicator" style="position: relative; top: 150px">
<div class="indicator"></div>
</div>
<div class="flow" style="position: relative; top: 30px">
<?php
foreach ($items as $delta => $item):
print render($item);
endforeach;
?>
</div>
</div>
<script>
var productsFlow = new ContentFlow('Products', {
reflectionHeight: 0,
scaleFactor: 2.3,
flowSpeedFactor: 0.15,
onclickActiveItem: function (item) {
var activeItem = productsFlow.getActiveItem();
var index = productsFlow.items.indexOf(activeItem);
$.fancybox.open([
<?php
foreach ($items as $delta => $item):
echo "{";
?????IMAGEPATH????
echo "},";
endforeach;
?>
], {
padding: 0,
index: index ? index : 0
});
return false;
}
});
</script>
如何从 foreach 循环中的 $item 中获取图像路径?
提前谢谢你。