【问题标题】:Retrieve thumbnail URL from page properties in AEM 6.4 using sightly使用Sightly从AEM 6.4中的页面属性中检索缩略图URL
【发布时间】:2020-08-28 22:45:33
【问题描述】:

是否可以将缩略图选项卡的页面属性中的缩略图 URL 插入到元标记内的 og:image 中。我能够获取 pageTitle 和 description 属性的值,但不能获取图像。或者有没有更好的方法来处理这个问题?

<meta property="og:url" content="${head.pagePath}" />
<meta property="og:title" content="${properties.pageTitle}" />
<meta property="og:description" content="${properties['jcr:description']}" />
<meta property="og:image" content="imageURL" />

【问题讨论】:

    标签: aem sightly aem-6


    【解决方案1】:

    如果它是通过 DAM 提供的,您可以将其引用为 ${properties['image/fileReference']}(因此您可以通过这种方式使用网络再现)。如果资产附加到页面本身(直接上传),您可以使用 Thumbnail servlet 使用以下约定引用呈现的缩略图:/content/[path-to-the-page].thumb.319.319.png

    AEM 开箱即用地创建 48x48、140x100 和 319x319 缩略图,因为您计划使用它来通过 OpenGraph 协议提供对可重复使用的图像的引用,您可能需要自定义缩略图创建工作流程以将更高分辨率添加到管道中。

    【讨论】:

    • 感谢您的详细解释。我研究了社交共享核心组件源代码,最终重新使用 getThumbnail() 方法来获取按预期工作的页面缩略图参考。
    猜你喜欢
    • 1970-01-01
    • 2023-02-20
    • 2014-08-24
    • 1970-01-01
    • 2012-06-02
    • 1970-01-01
    • 1970-01-01
    • 2016-01-05
    • 1970-01-01
    相关资源
    最近更新 更多