1
图像介绍我有文件覆盖“blog_item.php”的问题。 我只想看到没有介绍性文字的每个类别中的第一幅图像。我能怎么做? 我写了这个代码:的Joomla 2.5视图仅适用于任何种类的预览
<?php
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).'" />';
}?>
<?php echo $this->$images->image_intro; ?>
你看到了什么?有没有错误?我注意到,在代码中无处不存在'$ this-> images - > ...',只有在最后一个语句中。 –
或者你可以尝试var_dump($ this-> images)来查看发生了什么?还有一件事,我在最后的声明中看到这是错误的。没有$的图像 – Nathanphan