• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Other [Solved]Twitter cards for xenforo.

#1
Hello all

I spend alot of time promoting my forum on twitter.
I Like the platform, and how fast you can get tons of visitors.

So i setup a feed with twitterfeed, to auto post to twitter.

Its farly easy

i explain the steps

You add the rss link to sections from diserered forum rss that you would like to auto cast to twitter





then next step select twitter, then setup how freg. it should be sync.

Only problem is, that when i member post, it will auto cast that to twitter also.
Good thing is that alot of visitors visit.



But!
So i dig into twitter apps some more.

And the perfect thing would be a so called twitter card.
https://dev.twitter.com/cards/overview

It looks nicer and have support for media of various formats.

here is a example using a website that have twittercards.
I have a github account and when posting link to a reposotory on twitter, it shows a nice card of the tweet.



Would be cool to have a option to have a card for our forum, with a card of new threads, made with a nice logo or video of the first post.

What you say, anyone up for the challenge :)
 

batpool52!

Well-known member
#4
#9
should be the page location, not home page location ;)
Not sure i understand.
I see you have a page other than homepage yourself, but how would i know what page to add.
So if i make a new thread i have to add that link to the meta ?

Maybe i misunderstood the twittercard uses

I wanna show the card each time i use the twittercard from anywhere on the forum.
 
Last edited:
#12
okay if i copy link from forum link and paste into tweed on twitter it works.
If i use xenforo's own tweet button i doesnt show card

UPDATE!!
Appenrently it works also wit xenfor tweet button, It just took a minut before it appered correctly.
All Works now.

Thx for the help m8 (y)
 
#13
Hi, could you please help with this tags ?
I want to change the value.

<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@nytimes">
<meta name="twitter:title" content="Parade of Fans for Houston’s Funeral">
<meta name="twitter:description" content="NEWARK - The guest list and parade of limousines with celebrities emerging from them seemed more suited to a red carpet event in Hollywood or New York than than a gritty stretch of Sussex Avenue near the former site of the James M. Baxter Terrace public housing project here.">
<meta name="twitter:image" content="http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg">
 
#15
Can someone walk me thru how to setup up twitter card on my xenforo website correctly. Thank you.
go into admin panel
then Appearance >Templates
search template open_graph_meta
in template under

HTML:
    <meta property="og:site_name" content="{$xenOptions.boardTitle}" />
    <xen:if is="{$avatar}"><meta property="og:image" content="{$avatar}" /></xen:if>
    <meta property="og:image" content="{xen:helper fullurl, @ogLogoPath, 1}" />
    <meta property="og:type" content="{xen:if $ogType, $ogType, article}" />
    <meta property="og:url" content="{xen:raw $url}" />
    <meta property="og:title" content="{xen:raw $title}" />
insert twitter card

Code:
    <meta property="og:site_name" content="{$xenOptions.boardTitle}" />
    <xen:if is="{$avatar}"><meta property="og:image" content="{$avatar}" /></xen:if>
    <meta property="og:image" content="{xen:helper fullurl, @ogLogoPath, 1}" />
    <meta property="og:type" content="{xen:if $ogType, $ogType, article}" />
    <meta property="og:url" content="{xen:raw $url}" />
    <meta property="og:title" content="{xen:raw $title}" />
    <meta name='twitter:card' content='summary_large_image'/>
    <meta name='twitter:image:src' content='http://i.imgur.com/YourImage.jpg'/>
    <meta name='twitter:site' content='@YourTwittername'/>
    <meta name='twitter:url' content={$requestPaths.fullUri}/>
    <xen:if is="{$description}"><meta property="og:description" content="{xen:raw $description}" /></xen:if>
    {xen:raw $ogExtraHtml}
    <xen:if is="{$xenOptions.facebookAppId}"><meta property="fb:app_id" content="{$xenOptions.facebookAppId}" /></xen:if>
    <xen:if is="{$xenOptions.facebookAdmins}"><meta property="fb:admins" content="{xen:helper implode, {$xenOptions.facebookAdmins}, ','}" /></xen:if>
validate your card at twitter https://cards-dev.twitter.com/validator

tweet any page and see if the picture turns up in twitter, can take a minut

if trouble shoot you may have to make a token etc for you forum to get it to work.
in admin forum options twitter and make a twitter app https://apps.twitter.com/

 
#18
its self explainable
link to your own picture and profile

<meta name='twitter:card' content='summary_large_image'/>
<meta name='twitter:image:src' content='http://i.imgur.com/YourImage.jpg'/>
<meta name='twitter:site' content='@YourTwittername'/>
<meta name='twitter:url' content={$requestPaths.fullUri}/>
 
#19
Alright, I am not sure I am understanding all this, so please bear with me. So if I post a tweet to twitter I get a blank card, no image. And its looking like a summary card.

So here is what I tested, I posted a tweet from our forum to twitter, when I did it did not show the avatar of the poster of that thread, it was blank, even if I do a new post and then tweet it same thing. Blank? Can you give me a little more help please.
 
#20
did you upload a image you wanna use for your twitter card
that what the
<meta name='twitter:image:src' content='http://i.imgur.com/YourImage.jpg'/>

is for

also
<meta name='twitter:url' content={$requestPaths.fullUri}/>
is using the same image on all tweets, no matter where in your forum it is tweeted from.