Skip to content

Commit

Permalink
fix tag behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
jadwigo committed Sep 1, 2014
1 parent ee5cb82 commit 404ac5d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ function twigTaxonomyList($name = false, $params = false) {

if(array_key_exists($name, $taxonomy)) {
$named = $taxonomy[$name];
if($params != false) {
if($params != false || $named['behaves_like']=='tags') {
$named = $this->getFullTaxonomy($name, $taxonomy, $params);
}

if(array_key_exists('options', $named)) {
// \Dumper::dump($named);

foreach($named['options'] as $slug => $item) {

if(is_array($item) && $item['name']) {
Expand All @@ -91,6 +91,10 @@ function twigTaxonomyList($name = false, $params = false) {
} else {
$catname = $item;
$itemcount = null;
$item = array(
'name' => $catname,
'count' => null
);
}
$itemlink = $this->app['paths']['root'].$name .'/'.$slug;

Expand All @@ -100,7 +104,7 @@ function twigTaxonomyList($name = false, $params = false) {
'link' => $itemlink,
'count' => $itemcount,
);
if($item['weight']>=0) {
if(array_key_exists('weight', $item) && $item['weight']>=0) {
$options[$slug]['weight'] = $item['weight'];
$options[$slug]['weightclass'] = $item['weightclass'];
}
Expand Down

0 comments on commit 404ac5d

Please sign in to comment.