Joomla 3.1简介图片,了解更多链接 [英] Joomla 3.1 intro image as read more link
问题描述
在joomla 3.1中,我在此文件\components\com_content\views\featured\tmpl\default_item.php
In joomla 3.1 I edited in this file \components\com_content\views\featured\tmpl\default_item.php
<?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?>
<?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?>
<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>
<?php endif; ?>
收件人:
<?php if (isset($images->image_intro) && !empty($images->image_intro)) : ?>
<?php $imgfloat = (empty($images->float_intro)) ? $params->get('float_intro') : $images->float_intro; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"><a href="<?php echo $this->item->readmore_link; ?>"> <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); ?>"/></a> </div>
<?php endif; ?>`
但是它不能正常工作,因为正在链接到主页...我该如何解决,我尝试了所有操作,但是没有用 Joomla介绍图像为更多链接
but its not working correct, because is linking to the main page... how I can fix this, I tried everything from this, but it does not work Joomla intro image as read more link
推荐答案
首先,永远不要编辑核心文件.而不是编辑\components\com_content\views\featured\tmpl\default_item.php
,您应该复制文件并将其放在此处-/templates/YOUR TEMPLATE/html/com_content/featured/default_item.php
.
First of all, you should never edit a core file. Instead of editing \components\com_content\views\featured\tmpl\default_item.php
, you should make a copy of the file and place it here - /templates/YOUR TEMPLATE/html/com_content/featured/default_item.php
.
这将防止Joomla在进行更新/升级时覆盖任何更改.这也可能就是为什么您没有在网站上看到更改的原因.您的模板文件夹中已经很可能有\components\com_content\views\featured\tmpl\default_item.php
的模板替代.如果有,Joomla将使用该文件而不是您正在编辑的核心文件.在您的模板替代中进行更改,它应该可以正常工作.
This will prevent Joomla from overwriting any changes when there is an update/upgrade. This is probably also why you are not seeing the change on your site. There is very likely a template override for \components\com_content\views\featured\tmpl\default_item.php
already in your template folder. If there is, Joomla will use that file instead of the core file you are editing. Make your changes in your template override and it should work.
这篇关于Joomla 3.1简介图片,了解更多链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!