[SOLVED] Show article images in module Articles Newsflash

Everything to do with Joomla! 2.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
alekks
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Wed Jan 23, 2008 8:05 pm

[SOLVED] Show article images in module Articles Newsflash

Post by alekks » Sun May 20, 2012 2:21 pm

Hi,

There's an option for showing the articles images in the newsflash articles... Is this the images put in the editor or the images you associate with the article (intro and full article images)?

Since the module doesn't show the intro/full article images I'm guessing this option is for images put in the text...

So my question then is: how can I get the images (intro/full article) to show in the Newsflash module?

Thanks for your help!
Last edited by alekks on Thu May 24, 2012 8:16 pm, edited 1 time in total.

alekks
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Wed Jan 23, 2008 8:05 pm

Re: Show article images in module Articles Newsflash

Post by alekks » Mon May 21, 2012 8:33 pm

No one know how to implement some kind of code to be able to show the intro image associated to the article showing in the newsflash module?

Thanks.

alekks
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Wed Jan 23, 2008 8:05 pm

Re: Show article images in module Articles Newsflash

Post by alekks » Thu May 24, 2012 8:14 pm

Well, I solved it by adding this to my override:

In the 'overridename_item.php' right under defined('_JEXEC') or die;, put this:
$images = json_decode($item->images);
Like below:

Code: Select all

<?php
/**
 * @package		Joomla.Site
 * @subpackage	mod_articles_news
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

$images = json_decode($item->images);
?>
And then just put this where I want the image:

Code: Select all

<img src="<?php echo htmlspecialchars($images->image_intro); ?>" alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>

Alie
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed May 22, 2013 1:04 pm

Re: [SOLVED] Show article images in module Articles Newsflas

Post by Alie » Wed May 22, 2013 1:08 pm

Hi, Have you managed to get this working in Joomla 3? Thanks

PROBLEM SOLVED:

I found the answer here (http://forum.joomla.org/viewtopic.php?t=721147)
Use the following format instead:

<img src="<?php echo json_decode($item->images)->image_intro; ?>"/>

User avatar
modernmagic
Joomla! Explorer
Joomla! Explorer
Posts: 324
Joined: Mon Aug 10, 2009 3:58 pm
Location: Laguna Beach
Contact:

Re: [SOLVED] Show article images in module Articles Newsflas

Post by modernmagic » Thu Oct 09, 2014 8:44 am

How do you display the full-article-image?

"image_full" does not work when I replace it here:

Code: Select all

<?php echo json_decode($item->images)->image_intro; ?>
Joomla! Website Designer http://www.modernmagic.com
Joomla! User Group Leadership Team http://www.ocjoomlausergroup.org/

User avatar
modernmagic
Joomla! Explorer
Joomla! Explorer
Posts: 324
Joined: Mon Aug 10, 2009 3:58 pm
Location: Laguna Beach
Contact:

Re: [SOLVED] Show article images in module Articles Newsflas

Post by modernmagic » Thu Oct 09, 2014 8:47 am

trial and error got me this :-)

Code: Select all

<?php echo htmlspecialchars($images->image_fulltext); ?>
Joomla! Website Designer http://www.modernmagic.com
Joomla! User Group Leadership Team http://www.ocjoomlausergroup.org/

Dgikar
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Feb 28, 2012 8:52 pm
Location: Kiev, Ukraine

Re: [SOLVED] Show article images in module Articles Newsflas

Post by Dgikar » Sat May 02, 2015 5:31 pm

For me, work this:

Code: Select all

<img src="<?php echo json_decode($item->images)->image_intro; ?>" alt="<?php echo $item->title; ?>"/>

krishunt
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 114
Joined: Wed Feb 08, 2012 8:37 pm

Re: [SOLVED] Show article images in module Articles Newsflash

Post by krishunt » Tue Jun 28, 2016 12:40 am

Thanks for posting your solution, Alekks! This helped me.

StefanSTS
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Jul 30, 2015 7:39 am

Re: [SOLVED] Show article images in module Articles Newsflash

Post by StefanSTS » Fri Jul 08, 2016 8:11 am

Thanks for your answers. Helped a lot.

Oldie but goldie. ;-)

Stefan


Locked

Return to “Templates for Joomla! 2.5”