?
avatar htmgarcia
htmgarcia
27 Nov 2014

Joomal 3.3.6

The Module Articles - Newsflash has the param " Show Images" but no image is displayed when is set to yes.

My suggestion is add the following code after https://github.com/joomla/joomla-cms/blob/staging/modules/mod_articles_news/tmpl/_item.php#L12

$images = json_decode($item->images);

if( $images->image_intro && $params->get('image') ){
    echo '<img class="img-rounded" src="' . JURI::base() . $images->image_intro . '" alt="' . htmlspecialchars($article->title) . '" />';
}
avatar htmgarcia htmgarcia - open - 27 Nov 2014
avatar jissues-bot jissues-bot - change - 27 Nov 2014
Labels Added: ?
avatar jissues-bot jissues-bot - change - 27 Nov 2014
Labels Added: ?
avatar brianteeman
brianteeman - comment - 27 Nov 2014

Doesnt the param refer to images INSIDE the content - not the image fields

On 27 November 2014 at 21:44, Valentín notifications@github.com wrote:

Joomal 3.3.6

The Module Articles - Newsflash has the param " Show Images" but no image
is displayed when is set to yes.

My suggestion is add the following code after
https://github.com/joomla/joomla-cms/blob/staging/modules/mod_articles_news/tmpl/_item.php#L12

$images = json_decode($item->images);

if( $images->image_intro && $params->get('image') ){
echo 'https://github.com/joomla/joomla-cms/issues/5229.

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar htmgarcia
htmgarcia - comment - 27 Nov 2014

Hi @brianteeman ,
thanks for your reply.

Your comment is correct. IMHO the Intro image field should have higher priority, or at least consider display images from both sources (content and fields)

avatar brianteeman
brianteeman - comment - 27 Nov 2014

Yeah if you look here https://github.com/joomla/joomla-cms/blob/staging/modules/mod_articles_news/helper.php#L107 you will see what i mean. It is referring to images inside the content

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5229.

avatar brianteeman
brianteeman - comment - 27 Nov 2014

By all means submit a PR for that and then the maintainers can consider it

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5229.

avatar brianteeman
brianteeman - comment - 2 Jan 2015

Setting to Information Required. @htmgarcia are you planning to submit a PR for this new feature or shall we close this.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5229.

avatar brianteeman brianteeman - change - 2 Jan 2015
Status New Information Required
avatar htmgarcia
htmgarcia - comment - 6 Jan 2015

Sorry for the late.
I was planning make a PR but may take some time for me to get familiar with the workflow.

I'm closing it. I will reopen it when I'm ready.
Thanks.

avatar htmgarcia htmgarcia - close - 6 Jan 2015
avatar htmgarcia htmgarcia - close - 6 Jan 2015
avatar htmgarcia htmgarcia - change - 6 Jan 2015
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2015-01-06 23:43:25
avatar leetempest
leetempest - comment - 6 May 2015

Awesome thanks for the code, this should be included in any new releases.

avatar cct27
cct27 - comment - 21 Jul 2017

@htmgarcia Thanks for the little bit of code to insert the images. I spent a lot of time trying to figure out why the images wouldn't show only to find out it was only related to content images. Yes, content images could be something that works for some people, but I agree more weight or importance should have gone to the intro images first.

Anyhow, I'm a beginner in coding and now trying to figure out how to add code so that the images that are now showing will link to the article. Would you have any coding to do this or advice on how to learn or create such code?

PS I added your code in at Line 25 so as to put the image after the title.

Thanks
FP

avatar cct27
cct27 - comment - 22 Jul 2017

OK got the code sorted, to add link to the intro images also I used this code

<?php endif; $images = json_decode($item->images);
if( $images->image_intro && $params->get('image') ){
echo '<a href="'.$item->link.'"><img class="img-rounded" src="' . JURI::base() . $images->image_intro . '" alt="' . htmlspecialchars($article->title) . '" /></a>';

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Jul 2017

@cct27 can you make a PR against 3.8-branch?

avatar cct27
cct27 - comment - 22 Jul 2017

Hi Franz, sorry but I'm new to all this so no idea what a PR is (maybe personal request?) and don't know who/what 3.8-branch is?
Not much help I'm afraid :(

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Jul 2017

PR = Pull request (Info). If its not possible to make a PR maybe another Dev can take your Code.

Add a Comment

Login with GitHub to post a comment