无法在page-taxonomy.tpl.php中检索子项图像

问题描述

|| 我希望我的分类页面以特定方式设置样式。为此,我已经在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;
                }?>
    

解决方法

您缺少用于渲染图像的HTML代码。需要像处理父图像一样放入:
<img src=\"/sites/default/files<?php print $subterm_image;?>\" />