Using $this error with Elos template

Everything to do with Joomla! 3.x templates and templating.
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Jan 09, 2020 9:44 am

Using $this error with Elos template

Post by ashifdev » Thu Jan 09, 2020 10:21 am

Anybody here can help me, I am getting following error on

Using $this when not in object context

Call stack
# Function Location
1 () JROOT/libraries/src/Application/CMSApplication.php:370
2 Joomla\CMS\Application\CMSApplication::getMenu() JROOT/libraries/src/Application/SiteApplication.php:275
3 Joomla\CMS\Application\SiteApplication::getMenu() JROOT/templates/elos/preset/index_default.php:14
4 require() JROOT/templates/elos/index.php:27
5 require() JROOT/libraries/src/Document/HtmlDocument.php:668
6 Joomla\CMS\Document\HtmlDocument->_loadTemplate() JROOT/libraries/src/Document/HtmlDocument.php:730
7 Joomla\CMS\Document\HtmlDocument->_fetchTemplate() JROOT/libraries/src/Document/HtmlDocument.php:545
8 Joomla\CMS\Document\HtmlDocument->parse() JROOT/libraries/src/Application/CMSApplication.php:1030
9 Joomla\CMS\Application\CMSApplication->render() JROOT/libraries/src/Application/SiteApplication.php:778
10 Joomla\CMS\Application\SiteApplication->render() JROOT/libraries/src/Application/CMSApplication.php:202
11 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49
Last edited by toivo on Thu Jan 09, 2020 11:14 am, edited 1 time in total.
Reason: mod note: split from someone else's topic - please create your own topics in the future!

User avatar
Joomla! Master
Joomla! Master
Posts: 39316
Joined: Sat Apr 05, 2008 9:58 pm

Re: Using $this error with Elos template

Post by Webdongle » Sat Jan 11, 2020 9:21 pm

Something is out of date ... please.
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 27418
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Using $this error with Elos template

Post by Per Yngve Berg » Sat Jan 11, 2020 10:26 pm

In JROOT/templates/elos/preset/index_default.php:14 change:

Code: Select all

$menu = &JSite::getMenu();

Code: Select all

$menu = JFactory::getApplication()->getMenu();


Return to “Templates for Joomla! 3.x”