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

Allow a custom page title to be defined for an article without a menu item #10838

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -415,6 +415,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_CREATED_BY_ALIAS_DESC="Enter an alias to be displayed instead of the name of the user who created the article."
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