f:uri.image 视图助手的 absolute 参数是最近才在 TYPO3 7.6.0 中添加的。见changelog:
功能:#64286 - 为 uri.image 和 image viewHelper 添加了绝对 url 选项
ImageViewhelper 和 Uri/ImageViewHelper 获得了一个新选项 absolute。使用此选项,您可以强制 ViewHelpers 输出绝对 url。
我建议升级到 TYPO3 7.6。
如果出于某种原因这对您来说是不可能的,您可以扩展 f:uri.image 视图助手。下面的代码未经测试,但应该适用于 6.2 LTS(我在 7.6 中从 TYPO3\CMS\Extbase\Service\ImageService 借用了部分代码):
namespace Vendor\ExtensionKey\ViewHelpers\Uri;
use TYPO3\CMS\Fluid\ViewHelpers\Uri\ImageViewHelper;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class ImageViewHelper extends ImageViewHelper
{
public function render(
$src = null,
$image = null,
$width = null,
$height = null,
$minWidth = null,
$minHeight = null,
$maxWidth = null,
$maxHeight = null,
$treatIdAsReference = false,
$absolute = false
) {
$uri = parent::render($src, $image, $width, $height, $minWidth, $minHeight, $maxWidth, $maxHeight, $treatIdAsReference);
if ($absolute) {
$uriPrefix = $GLOBALS['TSFE']->absRefPrefix;
$uri = GeneralUtility::locationHeaderUrl($uriPrefix . $uri);
}
return $uri;
}
}