Announcement

Collapse
No announcement yet.

Facebook og:title

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] Facebook og:title

    Hi,

    I'm trying to insert og:title into headerinclude like this:

    <meta property="og:title" content="{vb:raw thread.title}">

    but {vb:raw thread.title} appears to be empty in this template.

    any ideas how I can get around this?

    thanks,

    Alex

  • #2
    The issue I was trying to fix was that when posting a link to my forum on Facebook it wouldn't use the thread title, it would just use the title from the home page.

    After troubleshooting the page using Facebook's debugger it seemed to be picking up an incorrect canonical URL (so ended up with my default 404 page) and was using the default HTML Title from that page.

    Basically the problem is in SHOWTHREAD where it has
    PHP Code:
    <link rel="canonical" href="{vb:raw thread_url}" /> 
    This is returning a relative URL "showthread.php/xxxxxxx" and for some reason Facebook is interpreting this as http://my.forum/showthread.php/showthread.php/xxxxxxxx which of course doesn't exist.

    I changed the above code in SHOWTHREAD to
    PHP Code:
    <link rel="canonical" href="{vb:raw vboptions.bburl}/{vb:raw thread_url}" /> 
    so it returns the full absolute URL.

    Now Facebook scrapes the correct page and extracts the Title correctly without requiring an og: tag.

    Comment


    • #3
      Glad you sorted it and thanks for posting back the solution...I must confess I did something similar with my own site some time ago.
      MARK.B | vBULLETIN SUPPORT

      TalkNewsUK - My vBulletin 5.6.3 Demo
      AdminAmmo - My Cloud Demo

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X