Fatal error: Call to a member function isFrontpage() on null

GK User
Tue Jul 07, 2015 9:15 am
Hi!
I want to display some html code in template, on all pages except frontpage.

I placed this code to /gk_university/layouts/blocks/logo.php

Code: Select all
        <?php if(!$this->layout->isFrontpage()){?>
<small>My custom html code</small><?php
}?>
     </a>


But now I get error

Fatal error: Call to a member function isFrontpage() on null in /Applications/MAMP/htdocs/mysite/templates/gk_university/layouts/blocks/logo.php on line 65

How to fix it?
Thanks.
User avatar
Expert Boarder

GK User
Tue Jul 07, 2015 9:48 am
Hi,
sorry but we do not support custom php solutions.
If you need such a feature we suggest to use one of available extension : AdvancedModuleManager or MetaMod
or hire joomla php developer.
User avatar
Platinum Boarder

GK User
Tue Jul 07, 2015 11:17 am
Sorry, I have read this topic, where you provided help with same customization

https://www.gavick.com/forums/template- ... thod-26569

but this don't work for me.
User avatar
Expert Boarder

GK User
Tue Jul 07, 2015 11:21 am
User avatar
Expert Boarder

GK User
Tue Jul 07, 2015 2:40 pm
I fully understand, but maybe you have chosen wrong file to edit.....
and according to our new rules we cannot help in php customizations, anymore.
- old topic was from 2013.
User avatar
Platinum Boarder

GK User
Wed Jul 08, 2015 8:35 am
You didn't undertstand.
I posted Oficial Joomla documentation, because - this is a correct solution.

This method works fine:

Code: Select all
     <?php

if ($menu->getActive() != $menu->getDefault()) {?>
<small class="h1title">My custom html code </small>
<?php
}
?>
User avatar
Expert Boarder

GK User
Wed Jul 08, 2015 1:50 pm
Aaa sorry, I have been tired, big thanks.
It should help many people.
User avatar
Platinum Boarder


cron