[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. 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
浏览
471
首次发布
上次更新
评分 0.00 星 0 个评分
来自 axtona 的更多资源
巫师PRO
巫师PRO
将PHP和任何类型的HTML、CSS和JavaScript代码直接放入内容中!
所有Video Share Pro
所有Video Share Pro
这是使All Video Share成为最强大且用户友好的Joomla的关键功能
巴洛波Forms构建器专业版
巴洛波Forms构建器专业版
使用Balbooa Forms创建美观的Joomla联系表单。

相似的资源

[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.
返回
顶部