Schlagwörter
Um die Schlagwörter anzuzeigen erstellen wir einen Block, welcher den Name und die Anzahl URL von 9 Tags anzeigt.
Schlagwörter Block
<?php
$vid = 1; // Set the vid to the vocabulary id of the vocabulary you wish to list the terms from
$vocs[] = $vid;
$tags = tagadelic_get_weighted_tags($vocs, variable_get('tagadelic_levels', 12), variable_get('tagadelic_page_amount', '60'));
$tags = tagadelic_sort_tags($tags);
foreach ($tags as $tag) {
if ($tag->number_of_posts > 0) {
$tag->name .= " (".$tag->number_of_posts.")";
$outtag[] = $tag;
}
}
$outtag= @array_slice($outtag, 0, 9);
$output = theme('tagadelic_weighted', $outtag);
echo $output;
?>Als Eingabeformat verwenden wir PHP Code.
Dieser Block können wir in Drupal wieder verwenden durch folgender Code:
<?php
$block = module_invoke('block', 'block', 'view', '<strong>2</strong>'); /* block ID */
print $block['content'];
?>Gruppen:
