Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible to open the links to twitter users and/or URL's in a new window?
I have a twitter block using Views. I have tried to make the links show up in a new window but I can't find any options for that.
Any ideas?
Comments
Comment #1
abasso CreditAttribution: abasso commentedI personally think this should be by default, anyway, if you are willing to hack the module, you have to change the following lines in the _twitter_filter_text function to:
PS. this is only for usernames/hastags, not urls in the tweet, for that use something like external links module.
Comment #2
juampynr CreditAttribution: juampynr commentedThe issue mentioned by @abasso has been fixed at #1386518: Hashtag and Account Links Broken (extra slash).
I think it makes sense to open these links in a new window. Best would be to give that option within Views as a filter setting.
Waiting for someone to suggest a patch for this.
Comment #3
juampynr CreditAttribution: juampynr commentedActually, it does make total sense to open these links in new windows.
Committed to Drupal 6 and 7 versions. Many thanks.
http://drupalcode.org/project/twitter.git/commitdiff/f7a5621
http://drupalcode.org/project/twitter.git/commitdiff/8784ff8
Comment #4
kjholla CreditAttribution: kjholla commentedI have made massive changes to the Views that are used to display the tweets. This was done in version 6-3.0 beta 9 though.
My changes do the following:
The modified view code uses the Custom PHP Field module to add a Custom PHP field to the Twitter View.
The PHP code in this new field is as below:
Custom PHP Field 1:
Custom PHP Field 2:
Regards,
KH
Comment #5
juampynr CreditAttribution: juampynr commentedCould be great if we can get some of that stuff in. There was an old issue where someone asked for twitpic previews.
Could you please write a separate issue per feature with a patch? That way me and the rest of the community can review, discuss and finally commit them.
Thanks!
Comment #6
kjholla CreditAttribution: kjholla commentedTo be honest, I tried writing a patch to begin with; but failed. Hence, I went ahead and edited the Twitter view using the Views interface on the site. I no longer use the Twitter block and page views that come with the module - I have now modified it to use the above code within the View using the Custom PHP field.
I can give it one more go but this may require someone who is more well-versed with the Views module and how the Twitter module interacts with it.
Regards,
KH