Թաքսոնոմիայի կատալոգի թեմատիկացում
Բարի օր, խնդրում եմ ասեք, ով է հանդիպել տաքսոնոմիայի թեմատիզացման հետ, ունեմ սովորական արտադրանքի կատալոգ, ըստ ստանդարտի ցուցադրվում է բաժնի նկար, հետո բաժնի անունը և ենթաբառերի ցուցակը: Ես պետք է փոխեմ կարգը... մասնավորապես, որպեսզի նախ ցուցադրվի բաժնի անունը, հետո նկարն ու արդեն հետո ենթաբառերի (մասնաճյուղերի) ցուցակը... views-ում օգտագործում եմ կոդ ենթաբառերի ցուցադրման համար:
<?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 .=' ի՞նչ է նշանակում այդ կետը :) Նախապես շնորհակալություն...