php – Joomla介绍图片阅读更多链接
发布时间:2020-12-13 14:07:34 所属栏目:PHP教程 来源:网络整理
导读:我想让joomla文章介绍图像表现得像阅读更多,标题链接.因此,用户单击图像,然后加载文章. 我不是PHP专家,但也许这是readmore链接代码: a href="?php echo $this-item-readmore_link; ?" class="button?php echo $this-item-params-get('pageclass_sfx'); ?" ?
我想让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> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |