I do not get the images out of my article. The article var is initialized, but the images and pictures vars seem to be empty. Any hints what I do wrong here?

   $id = JFactory::getApplication()->input->getInt('id');
   $article = JTable::getInstance("content");
   $images = $article->item->images;
   echo $images;
   $pictures = json_decode($images);
   echo $pictures;

<?php echo $pictures->image_intro; ?>
  • So what, of the above, is being printed to screen? Which lines is generating a warning/notice/error? Commented May 15, 2019 at 23:08
  • Is the code part of template override, module or something else?
    – webchun
    Commented May 16, 2019 at 3:35

1 Answer 1


When developing, error reporting should be enabled. You'll see this:

Notice: Undefined property: Joomla\CMS\Table\Content::$item

Access the images like this:

$images = $article->images;
  • "When developing, error reporting should be enabled." - This is more useful advise than the corrected piece of code below it ;)
    – FFrewin
    Commented May 16, 2019 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.