[JoyFreak] Set Open Graph Image

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

Sem autorização para baixar
Compatibilidade com XF
  1. 2.2.x
Descrição curta
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:
CÓDIGO:
<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:
CÓDIGO:
arg-canonicalUrl="{{ link('canonical:threads', $thread, {'page': $page}) }}" />


Add below:
CÓDIGO:
</xf:if>


Save.

Example at Gaming Forum
Autor
axtona
Visualizações
460
Primeiro lançamento
Última atualização
Avaliações 0,00 estrelas 0 avaliações
Link quebrado? Enviar mensagem para a equipe NP que vamos ajudá-lo rapidamente!
Apoie o desenvolvedor Se você está satisfeito com o teste ou seu projeto gerou lucro, clique no botão “Mais informações” para apoiar o desenvolvedor comprando.

Mais recursos de axtona

[XFSkins] Thread Rating A
Topic Rating plugin adds a clean and easy-to-understand star rating system to XenForo topics
Visualizações
2
Atualizado
 Gestor de Ativos A
Gerenciador de Ativos dá uma maneira visual e organizada para administradores do XenForo gerirem imagens
Visualizações
24
Atualizado
[FF] Login Spaminator Admin Area Logs A
Simple mod that allows you to browse the Spaminator logs from inside the admin area
Visualizações
254
Atualizado

Recursos similares

[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.
Magnifying effect on article mode images roothacker
Visualizações
537
Atualizado
Voltar
Top