0

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

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

            <?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;
                }?>
4

1 回答 1

1

您缺少用于呈现图像的 HTML 代码。需要像你做父图像一样把它放进去:

<img src="/sites/default/files<?php print $subterm_image;?>" />
于 2011-06-24T02:52:40.493 回答