XF 2.1 meta og (facebook) tags and json data?

TUG

Active member
perhaps ive missed these items buried within all the new features for 2.1 after my upgrade, but searches havent resulted in much success (one single add on for meta og tags that gets terrible reviews and no support from the developer).

Is there a configuration item in here to implement meta og tags for thread as they get shared quite a bit on facebook, especially stickies!

what about adding basic json/schema info for threads as well? thanks!
 
Threads require custome template modification and custom thread fields. I've created the custom thread field og:title with the field ID as threadOGTitle under the thread block (I also put 40 characters max and set to admin only):

Then after this line in thread_view <xf:set var="$fpSnippet" value="{{ snippet($firstPost.message, 0, {'stripBbCode': true}) }}" />:

Replace the other "metadata" code with this:

HTML:
<xf:comment>Pass og:title along if set</xf:comment>
<xf:macro template="metadata_macros" name="metadata"
    arg-title="{$thread.custom_fields.threadOGTitle}"
    arg-description="{$fpSnippet}"
    arg-shareUrl="{{ link('canonical:threads', $thread) }}"
    arg-canonicalUrl="{{ link('canonical:threads', $thread, {'page': $page}) }}" />
(should just really be adding arg-title and not require a complete replacement)

But, that's not all.

Because og:title will be visible unless this modification is also made. A like to this suggestion with a guide on how to remove it, once modified, would be nice as there are a TON of things we can do with self placement in threads that "require" an add on to do simple modifications.
 
Last edited:
Top Bottom