Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display category title as page heading and page title when no menu item for com_content category #19195

Merged
merged 3 commits into from Jan 15, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions components/com_content/views/category/view.html.php
Expand Up @@ -184,13 +184,18 @@ public function display($tpl = null)
// we need to get it from the menu item itself
$menu = $menus->getActive();

if ($menu)
if ($this->category->title && strpos($menu->link, 'view=categories&id='))
{
$this->params->def('page_heading', $this->category->title);
$title = $title ?: $this->category->title;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this code, $title is null, so I I think this line should be changed to $title = $this->category->title;

$this->params->set('page_title', $title);
}
else
{
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
$title = $title ?: $this->params->get('page_title', $menu->title);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with above, this line should be changed to $title = $this->params->get('page_title', $menu->title);

}

$title = $this->params->get('page_title', '');

$id = (int) @$menu->query['id'];

// Check for empty title and add site name if param is set
Expand Down