I want to display the intro image of my categories on the category page.
I have a template override for the category blog.
Because of the layout, I need to place the code outside of the override - in the index.php.
Inside of the blog layout it's possible to load the intro image with following code:
<?php if ($this->category->getParams()->get('image')) : ?> <?php echo $this->category->getParams()->get('image'); ?> <?php endif; ?>
When I put this in the index.php following error appears:
Notice: Undefined property: JDocumentHtml::$category in C:\xampp\htdocs\PATHTOTEMPLATE\index.php on line 101
Fatal error: Call to a member function getParams() on null in C:\xampp\htdocs\PATHTOTEMPLATE\index.php on line 101
Is this even possible to load it like this? Or does it need to be in the category view?