Hallo Forum,
Ich habe ebenfalls versucht, mein Einleitungsbild mit einem Override von _item.php mit einem Link zu versehen, habe dabei die Anleitung von Damian benutzt, leider ergibt sich bei mir nach dem Einfügen immer ein Umleitungsfehler und die Seite wird nicht mehr dargestellt..
Die _item.php steht in mod_articles_news_adv
Könnt Ihr mir helfen?
Vielen Dank für eine Antwort
Code:
<?php
/**
* Articles Newsflash Advanced
*
* @license
www.gnu.org/licenses/gpl-2.0.html
GNU/GPLv2
*
*/
defined('_JEXEC') or die;
$item_heading = $params->get('item_heading', 'h4');
$item_images = json_decode($item->images);
$urls = json_decode($this->item->urls);
?>
<!-- Item title -->
<?php if ($params->get('item_title')) : ?>
<<?php echo $item_heading; ?> class="item_title item_title__<?php echo $params->get('moduleclass_sfx'); ?>">
<?php if ($params->get('link_titles') && $item->link != '') : ?>
<a href="<?php echo $item->link;?>">
<?php echo $item->title;?></a>
<?php else : ?>
<?php echo $item->title; ?>
<?php endif; ?>
</<?php echo $item_heading; ?>>
<?php endif; ?>
<div class="item_content">
<!-- Intro Image -->
<?php if ($params->get('intro_image')): ?>
<?php if (isset($item_images->image_intro) and !empty($item_images->image_intro)) : ?>
<?php $imgfloat = (empty($item_images->float_intro)) ? $params->get('float_intro') : $item_images->float_intro; ?>
//new
<?php if (isset($urls) and !empty($urls->urla)) : ?>
<a href="<?php echo $urls->urla ?>" target="_blank">
<?php endif; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image">
<img
<?php if ($images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_intro); ?>"
alt="<?php echo htmlspecialchars($images->image_intro_alt); ?>"/>
</div>
//new
<?php if (isset($urls) and !empty($urls->urla)) : ?>
</a>
<?php endif; ?>
<?php endif; ?>
<div class="item_img img-intro img-intro__<?php echo htmlspecialchars($params->get('intro_image_align')); ?>">
<a href="<?php echo $item->link;?>">
<img
<?php if ($item_images->image_intro_caption):
echo 'class="caption"'.' title="' .htmlspecialchars($item_images->image_intro_caption) .'"';
endif; ?>
src="<?php echo htmlspecialchars($item_images->image_intro); ?>" alt="<?php echo htmlspecialchars($item_images->image_intro_alt); ?>"/></a>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (!$item_images->image_intro && $item_images->image_intro_caption): ?>
<i class="caption-ico <?php echo htmlspecialchars($item_images->image_intro_caption) ?>"></i>
<?php endif; ?>
<!-- Introtext -->
<?php if ($params->get('item_Introtext')) : ?>
<div class="item_introtext"><?php echo $item->introtext; ?></div>
<?php endif; ?>
<!-- Read More link -->
<?php if (isset($item->link) && $item->readmore != 0 && $params->get('readmore')) :
$readMoreText = JText::_('MOD_ARTICLES_NEWS_READMORE');
if ($item->alternative_readmore){
$readMoreText = $item->alternative_readmore;
}
echo '<a class="btn btn-info readmore" href="'.$item->link.'"><span>'. $readMoreText .'</span></a>';
endif; ?>
</div>
<div class="clearfix"></div>