[JoyFreak] Set Open Graph Image

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

Keine Berechtigung zum Herunterladen
XF-Kompatibilität
  1. 2.2.x
Kurzbeschreibung
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:
Code:
<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:
Code:
arg-canonicalUrl="{{ link('canonical:threads', $thread, {'page': $page}) }}" />


Add below:
Code:
</xf:if>


Save.

Example at Gaming Forum
Autor
axtona
Ansichten
451
Erste Veröffentlichung
Letzte Aktualisierung
Bewertungen 0.00 Sterne 0 Bewertungen
Link defekt? Nachricht senden an das NP-Team – wir helfen dir schnell!
Unterstütze den Entwickler Wenn du mit dem Test zufrieden bist oder mit deinem Projekt erfolgreich Geld verdient hast, klicke auf den Button Mehr Informationen, um den Entwickler durch einen Kauf zu unterstützen.

Weitere Ressourcen von axtona

Persona - Personalise Your Forum Identity A
Persona gives every member on your forum the tools to make their presence their own.
XenForo Medien-Galerie/XFMG A
XenForo Medien-Galerie ist ein offizielles XenForo-Add-On, das Ihnen eine Galerie hinzufügen kann.
Relevio.ai A
Relevio.ai 1.0.0
Dies ist der XenForo Add-On für Relevio, ein universtarer kontextbewusster, regelbasiertes Moderationsengine

Ähnliche Ressourcen

[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.
Zurück
Oben