Meta Tag error.

itsmeniik

New member
Hi,

I cannot seem to get the first image attached on the thread to pull as the image on a facebook post.

Below is the code I have entered in the "Thread_view" can you tell me where I am going wrong.

Code:
<xf:if is="{$thread.FirstPost.Attachments.first().thumbnail_url}">
    <xf:macro template="metadata_macros" name="metadata"
    arg-siteName="{$siteName}"
    arg-title="{$title}"
    arg-description="{$fpSnippet}"
    arg-shareUrl="{{ link('canonical:threads', $thread) }}"
    arg-imageUrl="{{ link('canonical:attachments', $thread.FirstPost.Attachments.first()) }}"
    arg-twitterCard="summary_large_image"/>
    
<xf:else/>
<xf:macro template="metadata_macros" name="metadata"
    arg-siteName="{$siteName}"
    arg-title="{$title}"
    arg-description="{$fpSnippet}"
    arg-shareUrl="{{ link('canonical:threads', $thread) }}"
    arg-imageUrl="{{ link('canonical:attachments', $thread.FirstPost.Attachments.first()) }}"
    arg-twitterCard="summary_large_image"/>
</xf:if>
 
Hello Sir.
This is the code I have on my website. I just try on Facebook and Twitter shares, and it's working (pulling well the attached image of the posts)

Code:
<!-- Metadatos Opengraph   -->
<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/>
<!-- Metadatos Opengraph   -->
<xf:macro template="metadata_macros" name="metadata"
    arg-description="{$fpSnippet}"
    arg-shareUrl="{{ link('canonical:threads', $thread) }}"
    arg-canonicalUrl="{{ link('canonical:threads', $thread, {'page': $page}) }}" />
</xf:if>

Kind regards
 
Top Bottom