Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 01 Aug 2015, 15:20
ku-med's Avatar
ku-med ku-med is offline
 
Join Date: Aug 2013
Bunny! Twitter Card Feature!

Hello!

I want to ask how to setup this cool feature of twitter to my vbulletin forum

https://dev.twitter.com/cards/types/summary

I don't know where to post that code?

Any ideas how to make that work in vbulletin?

Thanks in advance!
Reply With Quote
  #2  
Old 01 Aug 2015, 16:47
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Location: Lancashire, UK
I added it to the top bit of the headinclude template bellow all the other meta stuff.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #3  
Old 01 Aug 2015, 16:52
ku-med's Avatar
ku-med ku-med is offline
 
Join Date: Aug 2013
Thanks mate : ) : ) : )

Edit:

Hmm will the twitter card content display the text of each topic when i post the url in twitter ? or it will just display my site description by using this code {vb:raw vboptions.description} ?

Last edited by ku-med; 01 Aug 2015 at 17:10.
Reply With Quote
  #4  
Old 04 Aug 2015, 20:21
ku-med's Avatar
ku-med ku-med is offline
 
Join Date: Aug 2013
Whenever someone post a link of any thread in the forums, I'd like to see in the twitter card: Title of thread plus the first lines text of that thread. So I've tried to put this code in the SHOWTHREAD but it didn't work tho .. Any ideas how to make that work? Like in this pic ignoring the image thumbnail.



<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@mytwitteraccount" />
<meta name="twitter:description" content="{vb:raw thread.meta_description}" />
<meta name="twitter:title" content="{vb:raw thread.prefix_plain_html} {vb:raw thread.title}" />

--------- Edit ------------

Finally it's worked
I had to add these two codes in the showthread template at the end before </html>

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Last edited by ku-med; 09 Aug 2015 at 09:06. Reason: Figured it out!
Reply With Quote
  #5  
Old 23 Nov 2015, 04:10
VICOS VICOS is offline
 
Join Date: Mar 2002
You could actually put


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

in the SHOWTHREAD template right under <title></title>, then they would be inside of the <head></head> where technically they belong.

Then, I changed headinclude to look like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Just look for the following line in headinclude as the place to sync up.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and then add the Twitter stuff in where it belongs among the existing code as shown above. You have to go through all of this because the Thread Title and Meta Description are not available as variables in the headinclude template.

This way, you will get a Twitter card that makes sense for each of the following type of pages: 1) A forum page, 2) a Thread , 3) any other page. Hope this helps.

Last edited by VICOS; 23 Nov 2015 at 04:17.
Reply With Quote
  #6  
Old 15 Mar 2016, 13:14
PedroMA's Avatar
PedroMA PedroMA is offline
 
Join Date: Oct 2014
Real name: Pedro Martínez Alhambra
I'm searching about that the "twitter:image" charge automatically the first image attach. Any idea?

--------------- Added 15 Mar 2016 at 14:22 ---------------

I'm trying with


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

but doesn't work.

Last edited by PedroMA; 15 Mar 2016 at 13:23.
Reply With Quote
  #7  
Old 15 Mar 2016, 15:00
VICOS VICOS is offline
 
Join Date: Mar 2002
That's the way most people would probably like it to work, but, if I remember correctly, this is not easily accomplished within the framework of vB v4. You would probably have to write/mod PHP code to make this happen. I imagine that there is a table with a 1-MANY relationship which maps the postID to attachments. References to attachments are probably only available in the section of code which loops thru all of the posts in a thread and displays them.

So, you would have to find the first post in a thread and then query the attached images, select the first one and make this data available in the section of code which processes the <head></head> section of the output.
Reply With Quote
  #8  
Old 15 Mar 2016, 16:02
z3r0's Avatar
z3r0 z3r0 is offline
 
Join Date: Apr 2005
Location: Lancashire, UK
According to the twittercard dev page if the tag isn't present then it will fall back and look for opengraph properties, so you should be able to leave out the twitter:image tag and let the following mod put the opengraph ones in.

http://www.vbulletin.org/forum/showthread.php?p=2434215
Reply With Quote
  #9  
Old 15 Mar 2016, 21:23
PedroMA's Avatar
PedroMA PedroMA is offline
 
Join Date: Oct 2014
Real name: Pedro Martínez Alhambra
Originally Posted by z3r0 View Post
According to the twittercard dev page if the tag isn't present then it will fall back and look for opengraph properties, so you should be able to leave out the twitter:image tag and let the following mod put the opengraph ones in.

http://www.vbulletin.org/forum/showthread.php?p=2434215
No, In my case without image meta doesn't charge anything. I need this for CMS, and I'm triying to insert the meta tags inside the headinclude or inside vbcms_content_article_page. The problems is that in headinclude or vbcms_content_article_page I can't catch attachments variable information.

Thanks for the reply. More ideas?

Regards.
Attached Images
File Type: jpg Captura de pantalla 2016-03-15 a las 22.19.21.jpg (61.0 KB, 29 views)

Last edited by PedroMA; 16 Mar 2016 at 14:17.
Reply With Quote
  #10  
Old 30 Oct 2016, 23:23
PedroMA's Avatar
PedroMA PedroMA is offline
 
Join Date: Oct 2014
Real name: Pedro Martínez Alhambra
I need to solve the issue. Something from vbulletin support staff can help me?
Reply With Quote
  #11  
Old 31 Oct 2016, 03:59
Elixar's Avatar
Elixar Elixar is offline
 
Join Date: Jan 2014
Originally Posted by PedroMA View Post
I need to solve the issue. Something from vbulletin support staff can help me?
This is the place to get support for stuff like this, and members of the community primarily help so it's done primarily by volunteers.
Reply With Quote
  #12  
Old 31 Oct 2016, 11:54
PedroMA's Avatar
PedroMA PedroMA is offline
 
Join Date: Oct 2014
Real name: Pedro Martínez Alhambra
Originally Posted by Elixar View Post
This is the place to get support for stuff like this, and members of the community primarily help so it's done primarily by volunteers.
Ok. Any idea? I can't catch the article image in twitter cards.
__________________
Do you like guitar? if yes: GuitarBEND.com
Reply With Quote
  #13  
Old 31 Oct 2016, 20:38
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
 
Join Date: Sep 2008
Real name: Michael Miller Jr
I modified the file related to the Criteria Display and used that variable as the meta, for the image I was actually just about to do that myself for a client when he put all work on hold (so he can budget x-mas etc) so I may have spare time later to whip something up otherwise I'll hide in the dark until the client is ready .

Edit: So you know though, probably going to require a query to snag an article image if it exist, use that variable in the template after registering it properly.
__________________
Daddy Does Dios and Figs!
https://www.linkedin.com/in/thelastsuperman

Search - Use the search feature to find similar issues/answers.
Information - Include screenshots, copy/pasted error codes, url etc.
Fixed - Please return to your thread/post and let us know how it was fixed!
Thanks - For participating! Click the "Like" on a post if someone helped you!
Reply With Quote
  #14  
Old 05 Nov 2016, 22:20
PedroMA's Avatar
PedroMA PedroMA is offline
 
Join Date: Oct 2014
Real name: Pedro Martínez Alhambra
Originally Posted by TheLastSuperman View Post
I modified the file related to the Criteria Display and used that variable as the meta, for the image I was actually just about to do that myself for a client when he put all work on hold (so he can budget x-mas etc) so I may have spare time later to whip something up otherwise I'll hide in the dark until the client is ready .

Edit: So you know though, probably going to require a query to snag an article image if it exist, use that variable in the template after registering it properly.
Yes, my problem is that I can catch the attach info, I can't catch the array information. Can you help me with this problem?
__________________
Do you like guitar? if yes: GuitarBEND.com
Reply With Quote
  #15  
Old 05 Aug 2017, 13:10
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Was there a way to get an image from a thread for twitter ?
Reply With Quote
Reply


Tags
image twitter cards, twitter cards vbulletin4


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 08:02.

Layout Options | Width: Wide Color: