Skip to content

Commit

Permalink
Add layout to category associations
Browse files Browse the repository at this point in the history
  • Loading branch information
Septdir committed Apr 24, 2018
1 parent 9183852 commit 1686ab3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -25,12 +25,13 @@ abstract class CategoryHelperAssociation
*
* @param integer $id Id of the item
* @param string $extension Name of the component
* @param string $layout Category layout
*
* @return array Array of associations for the component categories
*
* @since 3.0
*/
public static function getCategoryAssociations($id = 0, $extension = 'com_content')
public static function getCategoryAssociations($id = 0, $extension = 'com_content', $layout = null)
{
$return = array();

Expand All @@ -46,11 +47,13 @@ public static function getCategoryAssociations($id = 0, $extension = 'com_conten
{
if (class_exists($helperClassname) && is_callable(array($helperClassname, 'getCategoryRoute')))
{
$return[$tag] = $helperClassname::getCategoryRoute($item, $tag);
$return[$tag] = $helperClassname::getCategoryRoute($item, $tag, $layout);
}
else
{
$return[$tag] = 'index.php?option=' . $extension . '&view=category&id=' . $item;
$viewLayout = ($layout) ? '&layout=' . $layout : '';

$return[$tag] = 'index.php?option=' . $extension . '&view=category&id=' . $item . $viewLayout;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/helpers/association.php
Expand Up @@ -62,7 +62,7 @@ public static function getAssociations($id = 0, $view = null, $layout = null)

if ($view === 'category' || $view === 'categories')
{
return self::getCategoryAssociations($id, 'com_content');
return self::getCategoryAssociations($id, 'com_content', $layout);
}

return array();
Expand Down

0 comments on commit 1686ab3

Please sign in to comment.