Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-10-2012, 07:58 PM
Anyoldname Anyoldname is offline
 
Join Date: Jan 2009
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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" />
Reply With Quote
  #2  
Old 01-10-2012, 08:15 PM
LifesGreatestGift's Avatar
LifesGreatestGift LifesGreatestGift is offline
 
Join Date: Jul 2009
Location: Louisville, KY USA
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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}
Reply With Quote
  #3  
Old 01-10-2012, 08:38 PM
Anyoldname Anyoldname is offline
 
Join Date: Jan 2009
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 01-10-2012, 08:56 PM
LifesGreatestGift's Avatar
LifesGreatestGift LifesGreatestGift is offline
 
Join Date: Jul 2009
Location: Louisville, KY USA
Posts: 885
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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}"/>
Reply With Quote
Благодарность от:
Anyoldname
  #5  
Old 01-10-2012, 09:04 PM
Anyoldname Anyoldname is offline
 
Join Date: Jan 2009
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Aha, worked a treat. Thank you so much!
Reply With Quote
  #6  
Old 02-03-2012, 11:11 PM
CouponWCents CouponWCents is offline
 
Join Date: Jun 2011
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 02-07-2012, 09:03 PM
xertox xertox is offline
 
Join Date: Apr 2011
Location: Westlock AB
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 05-11-2012, 02:09 PM
dennisuello dennisuello is offline
 
Join Date: Mar 2005
Location: Reno, Nevada
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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".
Reply With Quote
  #9  
Old 06-06-2012, 10:50 PM
dennisuello dennisuello is offline
 
Join Date: Mar 2005
Location: Reno, Nevada
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm, this stopped working with 4.2.0 for me
Reply With Quote
  #10  
Old 07-19-2012, 02:49 PM
Domiav Domiav is offline
 
Join Date: Oct 2011
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:59 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04901 seconds
  • Memory Usage 2,257KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete