在标准的Joomla + Joomfish安装中,翻译文章时,可以选择为翻译上传不同的图像(例如法式包装与英文包装)。
翻译K2项目时,我看不到为项目提供翻译图像的选项。我是否在某处关闭了某个设置,或者在使用K2时这个标准的Joomfish功能是不可用的?
答案 0 :(得分:0)
我找到了一个可能的解决方案。也许这是一个很好的技巧,但它确实有效。
由于K2没有将图像的路径存储到数据库中,因此我使用了存储的其他字段。特别是,我使用了image_credits字段。
在该字段中,我将通过ftp或通过任何其他方式上传到服务器上的图像路径(/images/myimage.jpg)插入到图像文件夹中。
现在我对项目的模板覆盖进行了一些小的修改,在管理图像的if上添加了一个else分支
<?php else:
if(!empty($this->item->image_credits)): ?>
<figure class="itemImageBlock">
<a class="itemImage modal" rel="{handler: 'image'}" href="<?php echo $this->item->image_credits; ?>" title="<?php echo JText::_('K2_CLICK_TO_PREVIEW_IMAGE'); ?>">
<img src="<?php echo $this->item->image_credits; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:100%; height:auto;" />
</a>
</figure>
<?php endif; ?>
就是这样。现在我可以使用Joomfish“翻译”图像