Skip to content

Commit

Permalink
Allow a custom page title to be defined for an article without a menu…
Browse files Browse the repository at this point in the history
… item. Fixes #10838
  • Loading branch information
Michael Babker authored and wilsonge committed Sep 4, 2016
1 parent 4c630e5 commit 1724530
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions administrator/components/com_content/models/forms/article.xml
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,11 @@
description="JFIELD_READMORE_DESC"
size="25" />

<field name="article_page_title" type="text"
label="COM_CONTENT_FIELD_BROWSER_PAGE_TITLE_LABEL"
description="COM_CONTENT_FIELD_BROWSER_PAGE_TITLE_DESC"
size="25" />

<field name="article_layout" type="componentlayout"
label="JFIELD_ALT_LAYOUT_LABEL"
description="JFIELD_ALT_COMPONENT_LAYOUT_DESC"
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.com_content.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ COM_CONTENT_FEATURED_CATEGORIES_DESC="Optional list of categories. If selected,
COM_CONTENT_FEATURED_CATEGORIES_LABEL="Select Categories"
COM_CONTENT_FEATURED_ORDER="Featured Articles Order"
COM_CONTENT_FEATURED_TITLE="Articles: Featured"
COM_CONTENT_FIELD_BROWSER_PAGE_TITLE_DESC="Optional text for the &quot;Browser page title&quot; element to be used when the article is viewed with a non-article menu item. If blank, the article's title is used instead."
COM_CONTENT_FIELD_BROWSER_PAGE_TITLE_LABEL="Browser Page Title"
COM_CONTENT_FIELD_ARTICLETEXT_DESC="Enter the article content in the text area."
COM_CONTENT_FIELD_ARTICLETEXT_LABEL="Article Text"
COM_CONTENT_FIELD_CAPTCHA_DESC="Select the captcha plugin that will be used in the article submit form. You may need to enter required information for your captcha plugin in the Plugin Manager.<br />If 'Use Default' is selected, make sure a captcha plugin is selected in Global Configuration."
Expand Down
7 changes: 2 additions & 5 deletions components/com_content/views/article/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,8 @@ protected function _prepareDocument()
// If the menu item does not concern this article
if ($menu && ($menu->query['option'] != 'com_content' || $menu->query['view'] != 'article' || $id != $this->item->id))
{
// If this is not a single article menu item, set the page title to the article title
if ($this->item->title)
{
$title = $this->item->title;
}
// If a browser page title is defined, use that, then fall back to the article title if set, then fall back to the page_title option
$title = $this->item->params->get('article_page_title', $this->item->title ?: $title);

$path = array(array('title' => $this->item->title, 'link' => ''));
$category = JCategories::getInstance('Content')->get($this->item->catid);
Expand Down

0 comments on commit 1724530

Please sign in to comment.