[JoyFreak] Set Open Graph Image

[JoyFreak] Set Open Graph Image 2022-11-24

没有下载权限
XF 兼容性
  1. 2.2.x
摘要
This guide will help you to set your forum's open graph image.
This guide will help you to set your forum's open graph image. It will use the first image in your thread, whether linked directly or attached.

Open template: thread_view

Find:
代码:
<xf:set var="$fpSnippet" value="{{ snippet($firstPost.message, 0, {'stripBbCode': true}) }}" />


Add below:

HTML:
<xf:if is="$thread.cover_image">
<xf:macro template="metadata_macros" name="metadata"
    arg-description="{$fpSnippet}"
    arg-shareUrl="{{ link('canonical:threads', $thread) }}"
    arg-canonicalUrl="{{ link('canonical:threads', $thread, {'page': $page}) }}"
    arg-imageUrl="{$thread.cover_image}" />
<xf:else/>


Find:
代码:
arg-canonicalUrl="{{ link('canonical:threads', $thread, {'page': $page}) }}" />


Add below:
代码:
</xf:if>


Save.

Example at Gaming Forum
作者
axtona
浏览
399
首次发布
上次更新
评分 0.00 星 0 个评分
Link was Broken? Please 发送消息 给 NP 团队,我们会尽快为您处理!
支持开发者 如果您对测试满意或项目已成功盈利,可点击「更多信息」按钮,通过购买来支持开发者!

来自 axtona 的更多资源

Brazilian Language [PT-BR] A
Like the other available Brazilian Portuguese translation
SEO Audit A
SEO Audit 1.1.0
A comprehensive SEO auditing dashboard for XenForo administrators.
XenForo媒体图库 / XFMG A
XenForo媒体图集是官方的XenForo扩展程序,可让您在XF2中添加图集

相似的资源

[cXF] Node icons with image A
Would you like to change your default Font Awesome node icons with image like this?
Default image for trending threads H
modification trending threads without image will have an image by default.
顶部