Twitter added a new set of meta tags called "cards".

Related issue for Nodewords: #1664324: Add support for Twitter's new "cards" metatags

Files: 
CommentFileSizeAuthor
#20 metatag-n1664322-20.patch11.52 KBDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#18 metatag-n1664322-15_0.patch10.06 KBalexweber
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#16 metatag-n1664322-15.patch10.06 KBalexweber
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in sites/default/modules/metatag/metatag_twitter_cards/metatag_twitter_cards.metatag.inc.
[ View ]
#15 metatag-n1664322-15.patch521 bytesalexweber
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#14 metatag-n1664322-13.patch10.03 KBDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#13 metatag-n1664322-13.patch0 bytesDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#12 metatag_twittercard-1664322-12.patch5.69 KBidflood
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#11 metatag_twittercard-combining_sandbox-1664322-11.patch5.34 KBmiechiel
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch metatag_twittercard-combining_sandbox-1664322-11.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#8 metatag-twittercard_support-1664322-8.patch4.88 KBkerasai
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Comments

nico059’s picture

I just realease a sandbox project here: http://drupal.org/sandbox/nico059/1741784
I name it metatag_twittercard (could be changed if needed).
The code is inspired from the metatag_opengraph module.

Very basic for now (only support summary card type), but I will add the 2 others type asap
I'm waiting to participate to Twitter Card to test this module, so use at your own risk ;-)

Twitter Cards support the OpenGraph meta tags, so I leverage on this metatags (og:xyz..) for the description, title, image etc ... Not sure yet if this is the good strategy or if it's better to make metatag_twittercard independant (without dependency to the metatag_opengraph module)

Give me some feedback on this module and which feature you see important,

Enjoy ;-)

Paisible’s picture

+1
I vote for this feature too.

Tanzaho’s picture

I ma also following this thread since I am really interested.

Tanzaho’s picture

I used it, and added the 'image' and 'description' tag. Waiting for twitter approval now.

nico059’s picture

Hi Tanzaho, thank you for your interest in this small module.

Could you please share the code you added for image and description? A patch, I could merge ?

Thx,
Nico.

Tanzaho’s picture

I just sent you a mail. Check it out...

ipwa’s picture

I guess the next step would be for nico059 to make a patch on from Meta tags HEAD, adding his module as a sub module of Meta tags.

kerasai’s picture

StatusFileSize
new4.88 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Patch rolled from latest 7.x-1.x.

DamienMcKenna’s picture

Status:Active» Needs work

Good work, but metatag_twittercard_metatag_config_default_alter() needs to be updated for the Twitter tags :)

DamienMcKenna’s picture

miechiel’s picture

StatusFileSize
new5.34 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch metatag_twittercard-combining_sandbox-1664322-11.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

I also started a sandbox project (see #10) to extend metatag with Twitter Cards metatag. Here is my work patched on nico059 sandbox.
This patch adds more twitter cards metatags and is using a proper metatag_twittercard_metatag_config_default_alter() function. I also added the dependency in the info file.

I'am also thinking in adding more functionality for "media" files such as images and audio/video. So that the "player" and "image" Twitter Card can be used.

idflood’s picture

Status:Needs work» Needs review
StatusFileSize
new5.69 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Here is a patch from miechiel sandbox with some little fixes (3 whitepace issue and a double break at the same spot).

@DamienMcKenna: Anything else to have this committed to metatag?

DamienMcKenna’s picture

StatusFileSize
new0 bytes
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

How's about this? :)

DamienMcKenna’s picture

StatusFileSize
new10.03 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Doh.

alexweber’s picture

StatusFileSize
new521 bytes
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

The patch in #14 works partially as the "twitter:card" metatag's options and human-readable name are switched so it outputs the administrative title instead of the actual value in the metatag. Also, the site's twitter account should have its context set to to global.

Patch attached.

alexweber’s picture

StatusFileSize
new10.06 KB
FAILED: [[SimpleTest]]: [MySQL] Invalid PHP syntax in sites/default/modules/metatag/metatag_twitter_cards/metatag_twitter_cards.metatag.inc.
[ View ]

Doh! Correct patch attached.

Status:Needs review» Needs work

The last submitted patch, metatag-n1664322-15.patch, failed testing.

alexweber’s picture

StatusFileSize
new10.06 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

getting my butt kicked. this one should do it.

alexweber’s picture

Status:Needs work» Needs review
DamienMcKenna’s picture

StatusFileSize
new11.52 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

I decided to add a README.txt file for the submodule.

DamienMcKenna’s picture

Status:Needs review» Fixed

Committed! Thanks everyone!

DamienMcKenna’s picture

DamienMcKenna’s picture

Status:Fixed» Closed (fixed)

Version 7.x-1.0-beta3 has been released and includes this work. Am closing this issue in an effort to keep the issue queue clean. Thank you all for your continued help!

alexweber’s picture

Awesome :)

jbrown’s picture

Component:Code» Documentation
Status:Closed (fixed)» Active

This needs to be documented on the module front page.

Dave Reid’s picture

Component:Documentation» Code
Status:Active» Closed (fixed)

Added to homepage.

jbrown’s picture

Thanks!

jbrown’s picture

Issue summary:View changes

Added a link to the corresponding Nodewords issue.