【问题标题】:TYPO3 Image From Extension来自扩展的 TYPO3 图像
【发布时间】:2018-03-02 13:57:33
【问题描述】:

我是一个错字新手,想知道如何使以下代码在我的 HTML 模板文件中工作:

<img src="EXT:extension-name/Resources/Public/Images/Logo/logo-white.png" alt="logo.png">

期待您的回答,谢谢。

【问题讨论】:

    标签: typo3


    【解决方案1】:

    这不能在 HTML 文件中完成,但在 Fluid 模板文件中您应该使用 uri.resource viewhelper:

    <img src="{f:uri.resource(path: 'Images/Logo/logo-white.png')}" alt="Actual explanation of the logo content">
    

    如果在 Extbase 插件中使用,则无需执行任何其他操作。

    对于使用FLUIDTEMPLATE content object 的模板,您需要设置扩展名,例如使用extensionName: 'MyExt' 作为参数:

    <img src="{f:uri.resource(path: 'Images/Logo/logo-white.png', extensionName: 'MyExt')}" alt="Actual explanation of the logo content">
    

    或者在您的 TypoScript 设置中使用 controllerExtensionName

    【讨论】:

    • 喜欢吗?
    • Uups,刚从这里学到的:viewhelper
    猜你喜欢
    • 1970-01-01
    • 2013-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-16
    • 2018-06-23
    • 1970-01-01
    相关资源
    最近更新 更多