【问题标题】:How AEM DAM Asset renditions are getting used in AEM?AEM DAM 资产演绎版如何在 AEM 中使用?
【发布时间】:2017-07-05 01:17:54
【问题描述】:

我知道在将任何图像/资产上传到 AEM DAM 时会创建演绎版,但我想知道这些演绎版将如何使用?

通常在进行内容创作时,我们只会指向 DAM 资产路径,但从未使用图像的特定再现路径。 谁能帮我举一个使用这种演绎的例子。

【问题讨论】:

标签: aem dam


【解决方案1】:

您还可以考虑使用 acs-aem-commons 包附带的命名转换图像 Servlet。仅使用图像 URL 来动态控制图像的许多方面非常方便。

https://adobe-consulting-services.github.io/acs-aem-commons/features/named-image-transform/index.html

【讨论】:

    【解决方案2】:

    最常见的用例是通过使用 picture 元素来获得“响应式”图像(与 IE 一起使用时需要像 picturefill.js 这样的 polyfill)。

    这是一个取自Adobe documentation on Adaptive images的例子:

    <div data-picture>
        <div data-src='/content/dam/geometrixx-media/articles/meridien.png'></div>                                        
        <div data-src='/content/dam/geometrixx-media/articles/meridien.png/jcr:content/renditions/cq5dam.thumbnail.319.319.png'    data-media="(min-width: 769px)"></div>  
        <div data-src='/content/dam/geometrixx-media/articles/meridien.png/jcr:content/renditions/cq5dam.thumbnail.140.100.png'   data-media="(min-width: 481px)"></div>     
    </div>
    

    因此,将为data-media 中定义的视口断点呈现适当的图像。

    【讨论】:

    • @mickeroy 谢谢,但是当作者想从路径字段对话框中选择时,对上述编码风格的小查询,他们将能够只选择原始图像路径,但不正确的再现,我们需要在代码中处理吗?
    • 您可以在代码中轻松处理此问题。只要您有原始图像的路径,您就可以简单地将路径附加到它的再现。例如:data-src='${pathToImage}/jcr:content/renditions/cq5dam.thumbnail.140.100.png'
    • Touch UI 如何使用这种再现?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多