[JoyFreak] Set Open Graph Image

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

Нет прав на скачивание
Совместимость с XF
  1. 2.2.x
Краткое описание
A step-by-step guide to setting your forum's open graph image using the first thread image. Add a conditional macro for cover images and include canonical URLs in Open Graph metadata for better SEO. Example provided for Gaming Forum.
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
Просмотры
460
Первый выпуск
Последнее обновление
Оценки 0.00 звезды 0 оценок
Ссылка не работает? Отправить сообщение команде NP, и мы поможем вам очень быстро!
Поддержите разработчика Если вы довольны тестом или ваш проект приносит доход, нажмите кнопку «Больше информации», чтобы поддержать разработчика покупкой.

Больше Ресурсов от axtona

[XFSkins] Thread Rating A
Topic Rating plugin adds a clean and easy-to-understand star rating system to XenForo topics
Просмотры
2
Обновлено
 Aktieverketter A
Manager Asset дает администраторам XenForo видимый и организованный способ управлять изображениями
Просмотры
24
Обновлено
[FF] Login Spaminator Admin Area Logs A
Simple mod that allows you to browse the Spaminator logs from inside the admin area
Просмотры
253
Обновлено

Похожие ресурсы

Назад
Вверх