Latest News Thumbnail image link to article?

Hello,

Tny for grat Latest News module - its grat! But I would like that Thumbnail image link to article, but it dosen't? How to enable this option?

Thank you very much!
9 years 4 months ago #1 by redzy

Please Log in or Create an account to join the conversation.

  • Posted by TemplatePlazza (5310) Offline
Hi, you can edit this file :
root/modules/mod_latestnewsplusdate/tmpl/default.php
at lines 92 - 102 you will see this code :
if ( $showthumb && ($loadorder == 0) ) {
			if ( !empty($images->image_intro) ) { ?>
				<img src="<?php echo lnpResizeImageHelper::getResizedImage('/'.$item->image, $thumb_width, $thumb_height, 'crop'); ?>" alt="<?php echo $item->imgalt; ?>" title="<?php echo $item->imgtitle; ?>" style="height:<?php echo $thumb_height; ?>px;width:<?php echo $thumb_width; ?>px" />
			<?php } elseif ( empty($images->image_intro) && !empty($images->image_fulltext) ) { ?>
				<img src="<?php echo lnpResizeImageHelper::getResizedImage('/'.$item->image, $thumb_width, $thumb_height, 'crop'); ?>" alt="<?php echo $item->imgalt; ?>" title="<?php echo $item->imgtitle; ?>" style="height:<?php echo $thumb_height; ?>px;width:<?php echo $thumb_width; ?>px" />
			<?php } elseif ( empty($images->image_intro) && empty($images->image_fulltext) && ($item->image !== "0") ) { ?>
				<img src="<?php echo lnpResizeImageHelper::getResizedImage('/'.$item->image, $thumb_width, $thumb_height, 'crop'); ?>" alt="<?php echo $item->imgalt; ?>" title="<?php echo $item->imgtitle; ?>" style="height:<?php echo $thumb_height; ?>px;width:<?php echo $thumb_width ?>px" />
			<?php } else { ?>
			<img src="<?php echo $modulebase.'assets/default.gif'; ?>" style="width:<?php echo $thumb_width; ?>px; height:<?php echo $thumb_height; ?>px" alt="Thumbnail"/>
			<?php }
		}

try to change those lines to these ones :
if ( $showthumb && ($loadorder == 0) ) {
			if ( !empty($images->image_intro) ) { ?>
				<a href="<?php echo $item->link; ?>"><img src="<?php echo lnpResizeImageHelper::getResizedImage('/'.$item->image, $thumb_width, $thumb_height, 'crop'); ?>" alt="<?php echo $item->imgalt; ?>" title="<?php echo $item->imgtitle; ?>" style="height:<?php echo $thumb_height; ?>px;width:<?php echo $thumb_width; ?>px" /></a>
			<?php } elseif ( empty($images->image_intro) && !empty($images->image_fulltext) ) { ?>
				<a href="<?php echo $item->link; ?><img src="<?php echo lnpResizeImageHelper::getResizedImage('/'.$item->image, $thumb_width, $thumb_height, 'crop'); ?>" alt="<?php echo $item->imgalt; ?>" title="<?php echo $item->imgtitle; ?>" style="height:<?php echo $thumb_height; ?>px;width:<?php echo $thumb_width; ?>px" /></a>
			<?php } elseif ( empty($images->image_intro) && empty($images->image_fulltext) && ($item->image !== "0") ) { ?>
				<a href="<?php echo $item->link; ?><img src="<?php echo lnpResizeImageHelper::getResizedImage('/'.$item->image, $thumb_width, $thumb_height, 'crop'); ?>" alt="<?php echo $item->imgalt; ?>" title="<?php echo $item->imgtitle; ?>" style="height:<?php echo $thumb_height; ?>px;width:<?php echo $thumb_width ?>px" /></a>
			<?php } else { ?>
			<a href="<?php echo $item->link; ?><img src="<?php echo $modulebase.'assets/default.gif'; ?>" style="width:<?php echo $thumb_width; ?>px; height:<?php echo $thumb_height; ?>px" alt="Thumbnail"/></a>
			<?php }
		}
9 years 4 months ago #2 by TemplatePlazza

Please Log in or Create an account to join the conversation.

Hi, tnx for fast support. Why I place this code I lose thumbail and there is blank space... But I configure it my self. Here is code, plase comment is this Ok.

The code is form line 90 to 107. I have add a <a href="<?php echo $item->link; ?>">
<a href="<?php echo $item->link; ?>">
        <?php
        // to show thumbnail after the title
        if ( $showthumb && ($loadorder == 0) ) {
			if ( !empty($images->image_intro) ) { ?>
				<img src="<?php echo lnpResizeImageHelper::getResizedImage('/'.$item->image, $thumb_width, $thumb_height, 'crop'); ?>" alt="<?php echo $item->imgalt; ?>" title="<?php echo $item->imgtitle; ?>" style="height:<?php echo $thumb_height; ?>px;width:<?php echo $thumb_width; ?>px" />
			<?php } elseif ( empty($images->image_intro) && !empty($images->image_fulltext) ) { ?>
				<img src="<?php echo lnpResizeImageHelper::getResizedImage('/'.$item->image, $thumb_width, $thumb_height, 'crop'); ?>" alt="<?php echo $item->imgalt; ?>" title="<?php echo $item->imgtitle; ?>" style="height:<?php echo $thumb_height; ?>px;width:<?php echo $thumb_width; ?>px" />
			<?php } elseif ( empty($images->image_intro) && empty($images->image_fulltext) && ($item->image !== "0") ) { ?>
				<img src="<?php echo lnpResizeImageHelper::getResizedImage('/'.$item->image, $thumb_width, $thumb_height, 'crop'); ?>" alt="<?php echo $item->imgalt; ?>" title="<?php echo $item->imgtitle; ?>" style="height:<?php echo $thumb_height; ?>px;width:<?php echo $thumb_width ?>px" /> </a>
			<?php } else { ?>
			<img src="<?php echo $modulebase.'assets/default.gif'; ?>" style="width:<?php echo $thumb_width; ?>px; height:<?php echo $thumb_height; ?>px" alt="Thumbnail"/>
			<?php }
		}
		//echo html_entity_decode(htmlentities($item->introtext));
		//echo $item->introtext;
		echo $item->displayIntrotext;
        ?>
9 years 4 months ago #3 by redzy

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum