2011-05-23 96 views
0

我希望以特定方式对我的分类标准页面进行样式设置。为此,我在template.php中完成了必要的工作。现在我有page-taxonomy.tpl.php准备就绪并正在工作。我正在使用分类图像模块将图像上传到分类术语。我正在使用taxonomy_image_get_url($ term-> tid)检索对应词语的图像并显示它们。现在我想检索这个术语的子项,我已经能够使用_taxonomy_term_children($ term-> tid)无法在页面分类检索中找到子图像.tpl.php

问题是我无法检索它的图像。

  <?php if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) { 
       $term = taxonomy_get_term(arg(2)); 
       $image_url = taxonomy_image_get_url($term->tid); 
       print $image_url; 
      }?> 
      <div id="taxonomy_term_image"><img src="/sites/default/files<?php print $image_url;?>" /></div> 
      <div id="taxonomy_term_description"> <?php print $term->description;?>    <?php print $images_url;?></div> 
           <?php print $feed_icons; ?><br/> 
       Sub Categories: <?php $taxonomy_children = _taxonomy_term_children($term->tid); 
      foreach ($taxonomy_children as $value) { 
       $tax_child = taxonomy_get_term($value); 
       print $tax_child->name; 
       print $tax_child->description; 
       $subterm_image = taxonomy_image_get_url($taxchild->tid); 
            print $subterm_image; 
       }?> 

回答

1

你错过了HTML代码来呈现图像。需要按照您的父图像放入:

<img src="/sites/default/files<?php print $subterm_image;?>" />