2011-05-23 27 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;?>" />