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 に答える