我想让joomla文章介绍图像表现得像阅读更多,标题链接.因此,用户单击图像,然后加载文章.
我不是PHP专家,但也许这是readmore链接代码:
<a href="<?PHP echo $this->item->readmore_link; ?>" class="button<?PHP echo $this->item->params->get('pageclass_sfx'); ?>">
<?PHP if ($this->item->readmore_register) :
echo JText::_('Register to read more...');
elseif ($readmore = $this->item->params->get('readmore')) :
echo $readmore;
else :
echo JText::_("Read Article");
endif; ?></a>
这就是我想要对我的joomla网站上的每个介绍图像做的事情.
谢谢 !
刚刚解决了!
你的思维方式帮助了我.谢谢!
这是我的代码:
<a href="<?PHP echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug,$this->item->catid)); ?>">
<?PHP
$images = json_decode($item->images);
if (isset($images->image_intro) and !empty($images->image_intro)) {
$imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro;
$class = (htmlspecialchars($imgfloat) != 'none') ? ' class="size-auto align-'.htmlspecialchars($imgfloat).'"' : ' class="size-auto"';
$title = ($images->image_intro_caption) ? ' title="'.htmlspecialchars($images->image_intro_caption).'"' : '';
echo '<img'.$class.$title.' src="'.htmlspecialchars($images->image_intro).'" alt="'.htmlspecialchars($images->image_intro_alt).'" />';
}
echo $this->item->introtext;
?>
</a>