The attached patch adds the the option to "Link to twitter's profile page" to the Twitter: Profile image views field.

It also adds the title and alt attributes to the img tag for SEO & accessability porpuses, using the Twitter's real name.

Comments

manuel garcia’s picture

Title: Allow views twitter profile image to be linked to twitter profile page » Provide profile page url views field
StatusFileSize
new2.63 KB

I've changed my mind, and I think the best approach is to provide a new views field to get the user's twitter profile URL.

It can then be used with other fields, image, name, etc to link them to their twitter page, using all the options that views already provides.

The attached patch does that, and it provides a new helper function twitter_profile_url($twitter_screen_name).

juampynr’s picture

Status: Needs review » Needs work

After applying the patch, I went to the Tweets list at /user/1/tweets and got the following error:

Fatal error: Call to undefined method twitter_views_handler_field_profile_image::get_value() in /var/aegir/platforms/drupal-6.22/sites/all/modules/contrib/twitter/twitter_views_field_handlers.inc on line 70

Please have a look at the patch to see if it misses something.

manuel garcia’s picture

Status: Needs work » Needs review

I've just tested the patch against a fresh checkout of the 6.x-3.x branch, it applies cleanly and I can use the field without any errors.

Note that I'm using views 3 here, but in the sprint I believe I had views 2...

manuel garcia’s picture

Yup, the problem was the patch above only works on views 3.x...

Ive removed the offending modification, which was adding the title attribute to the profile_image handler, which is a different issue anyway.

Find attached the updated patch

juampynr’s picture

Title: Provide profile page url views field » Add Twitter profile URL field to Views
Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Needs review » Fixed

Committed.

This needs a port for Drupal 7 (7.x-3.x) branch.

http://drupalcode.org/project/twitter.git/commitdiff/476fd71

juampynr’s picture

Status: Fixed » Needs work

Changed status to needs work so a patch for 7.x-3.x can be provided.

cweagans’s picture

Issue tags: +Needs backport to D7
dddave’s picture

Version: 7.x-3.x-dev » 7.x-6.x-dev
damienmckenna’s picture

Issue summary: View changes
Status: Needs work » Needs review

The last submitted patch, link-twitter-image-to-profile-page.patch, failed testing.

The last submitted patch, 1: profile-page-url-views-field.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: profile-page-url-views-field-1346768-4.patch, failed testing.