The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
og image, title & url - Title doesn't display
I added the following code to headerinclude to display the correct thumbnail, title & url when people share links in facebook.
The thumb & the url work ok, but the link in facebook just displays {TITLE}. Not sure what I did wrong. I'm using 4.4.0 Code:
<meta property="og:title" content="{TITLE}"/> <meta property="og:url" content="{URL}"/> <meta property="og:image" content="http://www.occupyforum.org.uk/images/misc/facebook-thumb.jpg" /> |
#2
|
||||
|
||||
Title of thread or forum?
Thread is {vb:raw thread.title} and must be used in SHOWTHREAD template FORUM title is {vb:raw vboptions.bbtitle} |
#3
|
|||
|
|||
Ah ok great thanks!
So, I put: <meta property="og:title" content="{vb:raw thread.title}"/> in showthread and that does indeed now show the thread title when it is shared on fb. But I tried putting <meta property="og:title" content="{vb:raw vboptions.bbtitle}"/> in headinclude and forumhome (one after the other, not both at the same time), but the title still displays as {TITLE}. Should it go somewhere else? |
#4
|
||||
|
||||
there is no need to put anything in headinclude.
make sure you delete your original <meta property="og:title" content="{TITLE}"/> from whatever template you put it in, then in FORUMHOME add <meta property="og:title" content="{vb:raw vboptions.bbtitle}"/> and in FORUMDISPLAY add <meta property="og:title" content="{vb:raw foruminfo.title_clean} - {vb:raw vboptions.bbtitle}"/> incase someone decides to manually share a link to a forum instead of the main forum page (FORUMHOME) or a thread (SHOWTHREAD) SO.... ------------------------------------------------------------------ FORUMHOME <meta property="og:title" content="{vb:raw vboptions.bbtitle}"/> FORUMDISPLAY <meta property="og:title" content="{vb:raw foruminfo.title_clean} - {vb:raw vboptions.bbtitle}"/> SHOWTHREAD <meta property="og:title" content="{vb:raw thread.title}"/> if you'd like to include the name of your site after a thread title then do the following <meta property="og:title" content="{vb:raw thread.title} - {vb:raw vboptions.bbtitle}"/> |
Благодарность от: | ||
Anyoldname |
#5
|
|||
|
|||
Aha, worked a treat. Thank you so much!
|
#6
|
|||
|
|||
I had this in headinclude:
<meta property="og:title" content="{vb:raw vboptions.bbtitle}"/> <meta name="description" content="{vb:raw vboptions.description} " /> <meta http-equiv="Content-Type" content="text/html; charset={vb:stylevar charset}" /> <meta id="e_vb_meta_bburl" name="vb_meta_bburl" content="{vb:raw vboptions.bburl}" /> <base href="{vb:raw basepath}" /><!--[if IE]></base><![endif]--> <meta name="generator" content="vBulletin {vb:raw vboptions.templateversion}" /> I removed it all and added what you said above in those templates and it still isn't working. |
#7
|
|||
|
|||
This is what I used in showthread. Adds description to the facebook share. Google plus and twitter preview as well... Also adds page number if link is manually shared from page 2+ of the thread.
<meta property="og:site_name" content="Fatwillie.Net - Forums" /> <meta property="og:title" content="{vb:raw thread.prefix_plain_html} {vb:raw thread.title}<vb:if condition="$pagenumber > '1'"> - {vb:rawphrase page_x, {vb:raw pagenumber}}</vb:if>" /> <meta property="og:description" content="{vb:raw thread.meta_description}" /> <meta property="og:url" content="{vb:raw vboptions.bburl}/{vb:raw thread_url}" /> <meta property="og:type" content="article" /> I think it would be pretty sweet if there were some way to grab the video or image URL so that could be embedded via meta tags as well. Anyone know of a way to grab the video/img URL when it is submitted via the editor? |
#8
|
|||
|
|||
Thank you for figuring this out. It's been bugging me for a while that when I share a link on facebook it doesn't pull the tile and description from the thread. Now, it's all good and both of my forums are "fixed".
|
#9
|
|||
|
|||
hmmm, this stopped working with 4.2.0 for me
|
#10
|
|||
|
|||
hello guys, i'm having the same problem on 4.2.0; any one have a solution for it?
Previous ones doesn't work. Thank you! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|