分类目录的主题化
您好,请问一下谁遇到过分类法的主题化问题,我有一个普通的产品目录,按照标准显示的是分类的图片,然后是分类的名称,最后是子术语的列表。我需要更改顺序……也就是说,首先显示分类的名称,然后是图片,最后是术语(子分类)的列表……在视图中我使用以下代码来输出术语:
<?php
$vid = 4;
$cols = 1;
$limit = 5000;
$tree = taxonomy_get_tree($vid, 0, -1, 1);
if (!empty($tree)) {
$output = '<table class="catalog-root">';
$count = 0;
$total = count($tree);
foreach ($tree as $tid => $term) {
if ($count % $cols == 0) {
$output .= '<tr>';
}
$item = '<center>'.l(taxonomy_image_display($term->tid), taxonomy_term_path($term),array('html' => TRUE)).'</a></BR>';
$item .= '<strong><font style="font-size:25px; font-family: verdana;">'.l($term->name, taxonomy_term_path($term)).'</font></strong><BR>';
$children_list = array();
$children = taxonomy_get_children($term->tid, $vid);
$i = 1;
foreach (taxonomy_get_children($term->tid, $vid) as $child) {
$children_list[] = l($child->name, taxonomy_term_path($child));
if ($limit != 0 && $i >= $limit) break;
$i++;
}
if (count($children) > $limit) {
$children_list[] = l('...', taxonomy_term_path($term));
}
$count++;
$item .= implode(' <br> ', $children_list);
$output .= '<td align="center">'. $item .'</td>';
if ($count % $cols == 0 || $count == $total) {
$output .= '</tr>';
}
}
$output .= '</table>';
return $output;
}
?>
看起来很简单,但显然我对PHP不太熟悉,我不明白'$item ='和'$item .='中的点是什么意思 :) 提前谢谢您……