Found time to finish working through the tutorial. There is a typo in this section:
"Update controller
Edit the classes/XLite/Module/Tony/News/View/Model/NewsEdit.php file and add the following code there:"
The file path is wrong, it should be:
"classes/XLite/Module/Tony/News/Controller/Admin/NewsEdit.php"
Also, I added this code to the News controller in classes/XLite/Module/Tony/News/Controller/Customer/NewsEdit.php:
Code:
public function getNewsTitle()
{
$id = intval(\XLite\Core\Request::getInstance()->news_id);
$return = '';
if ($id != 0)
{
$news = \XLite\Core\Database::getRepo('XLite\Module\Tony\News\Model\News')->find($id);
if ($news) {
$return = $news->getTitle();
}
}
return $return;
}
/**
* Return the current page title (for the content area)
*
* @return string
*/
public function getTitle()
{
return 'News';
}
/**
* Common method to determine current location
*
* @return string
*/
protected function getLocation()
{
return $this->getTitle();
}
This allowed the section name "News" to be displayed in the bread crumb area and the page title. It also allowed me to use the function getNewsTitle() to display the title on the news page in the customer area after adding the following code to skins/default/en/modules/Tony/News/page/news/body.tpl
Code:
<h2>{getNewsTitle():h}</h2>
Thanks again for this learning experience, I feel much better about XC5 and my own ability to work with it.