Skip to content

Commit

Permalink
Add Check for Parent Category Level
Browse files Browse the repository at this point in the history
  • Loading branch information
coolcat-creations committed Jun 18, 2018
1 parent 1359304 commit 8d5023c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions administrator/components/com_content/models/articles.php
Expand Up @@ -206,11 +206,11 @@ protected function getListQuery()
->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');

// Join over the categories.
$query->select('c.title AS category_title, c.created_user_id as category_uid, c.level as category_level')
$query->select('c.title AS category_title, c.created_user_id AS category_uid, c.level AS category_level')
->join('LEFT', '#__categories AS c ON c.id = a.catid');

// Join over the parent categories.
$query->select('parent.title AS parent_category_title, parent.id AS parent_category_id, parent.created_user_id AS parent_category_uid')
$query->select('parent.title AS parent_category_title, parent.id AS parent_category_id, parent.created_user_id AS parent_category_uid, parent.level AS parent_category_level')
->join('LEFT', '#__categories AS parent ON parent.id = c.parent_id');

// Join over the users for the author.
Expand Down
Expand Up @@ -199,7 +199,9 @@
<div class="small">
<?php echo JText::_('JCATEGORY') . ':' ?>
<?php if ($item->category_level != '1') : ?>
<?php if ($item->parent_category_level != '1') : ?>
<?php echo ' » '; ?>
<?php endif; ?>
<?php if ($canEditParCat || $canEditOwnParCat) : ?>
<a class="hasTooltip"
href="<?php echo JRoute::_('index.php?option=com_categories&task=category.edit&id=' . $item->parent_category_id . '&extension=com_content'); ?>"
Expand Down

0 comments on commit 8d5023c

Please sign in to comment.