[JoyFreak] Set Open Graph Image

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

No tiene permiso para descargar
Compatibilidad con XF
  1. 2.2.x
Descripción breve
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
Vistas
460
Primer lanzamiento
Última actualización
Valoraciones 0,00 estrella(s) 0 valoraciones
¿Enlace roto? Enviar mensaje al equipo NP y te ayudaremos rápidamente!
Apoia al desarrollador i estás satisfecho con la prueba o tu proyecto te ha generado ganancias, haz clic en el botón «Más información» para apoyar al desarrollador comprando.

Más recursos de axtona

Sorcerer Pro A
Sorcerer Pro 13.1.1
Coloca el código PHP y cualquier tipo de código HTML, CSS y JavaScript en tu contenido!
Cleaner Pro A
Cleaner Pro 10.0.4
Cleaner de Cache también puede limpiar automáticamente el caché de Joomla! cuando se guarda un artículo o cualquier otro elemento.
Auto Cerrar + Nota de Hilo A
Notificación de Cierre Automático de Hilo ayuda a mantener las discusiones antiguas limpias sin sorprender a tus miembros.

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.
Atrás
Superior