? ? Success

User tests: Successful: Unsuccessful:

avatar OctavianC
OctavianC
2 Aug 2016

Pull Request for Issue #11215 .

Summary of Changes

This is just a helper function to allow developers to set the document title according to what options have been set in regards to the "Include Site Name in Page Titles" option from Global Configuration - without the need to duplicate this same logic in every view.

Testing Instructions

Call $this->setDocumentTitle($title); in your view's display() function; for example, this part from /components/com_users/views/login/view.html.php:

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

if (empty($title))
{
    $title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
    $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
    $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}

$this->document->setTitle($title);

Can be simplified into:

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

Same goes for all other components Joomla! is using, since they all duplicate the same code.

avatar joomla-cms-bot joomla-cms-bot - change - 2 Aug 2016
Category Libraries
avatar OctavianC OctavianC - open - 2 Aug 2016
avatar OctavianC OctavianC - change - 2 Aug 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Aug 2016
Labels Added: ?
avatar hardiktailored hardiktailored - test_item - 5 Aug 2016 - Tested successfully
avatar hardiktailored
hardiktailored - comment - 5 Aug 2016

I have tested this item successfully on 2c5f131

Tested. Works as it is. No problem found using new helper method setDocumentTitle().


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11399.

avatar truptikagathara truptikagathara - test_item - 8 Aug 2016 - Tested successfully
avatar truptikagathara
truptikagathara - comment - 8 Aug 2016

I have tested this item successfully on 2c5f131


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11399.

avatar brianteeman brianteeman - change - 8 Aug 2016
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 8 Aug 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11399.

avatar joomla-cms-bot joomla-cms-bot - change - 8 Aug 2016
Labels Added: ?
avatar wilsonge wilsonge - change - 18 Sep 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-09-18 15:46:18
Closed_By wilsonge
avatar wilsonge wilsonge - close - 18 Sep 2016
avatar wilsonge wilsonge - merge - 18 Sep 2016
avatar joomla-cms-bot joomla-cms-bot - close - 18 Sep 2016
avatar joomla-cms-bot joomla-cms-bot - close - 18 Sep 2016
avatar joomla-cms-bot joomla-cms-bot - change - 18 Sep 2016
Labels Added: ?
Removed: ?

Add a Comment

Login with GitHub to post a comment