https://drupal.org/sandbox/natts1/2287455
The Link Icons module is a field formatter for the Link field to display an icon for the service being linked to - ex. Facebook, Twitter or LinkedIn, with various display options available as settings of the formatter. The icons themselves are provided from the Font Awesome project.
Services/icons currently supported are:
- behance.net
- deviantart.com
- digg.com
- dribbble.com
- dropbox.com
- drupal.org
- facebook.com
- flickr.com
- foursquare.com
- github.com
- google.com (G+)
- instagram.com
- joomla.org
- jsfiddle.net
- linkedin.com
- pinterest.com
- reddit.com
- soundcloud.com
- spotify.com
- spotlight.com
- stackexchange.com
- stackoverflow.com
- stumbleupon.com
- tumblr.com
- twitter.com
- vimeo.com
- vine.co
- wordpress.com
- wordpress.org
- xing.com
- yahoo.com
- youtube.com
The generic globe icon is used if a link URL does not have one of the hostnames above.
Similar/related modules
The following modules may alternatively suit your needs:
- Link icon - has many more features than this module, including Font Awesome support, but may overcomplicate things for you
- Link favicon formatter - offers three methods to get the favicon for the site of the link, and then a formatting option
Requirements
The link field module, obviously, and the Font Awesome Icons module that adds the Font Awesome project to Drupal allowing the icons to be displayed.
Installation
Configuration
Just head to a content type display management tab (ex. http://yoursite.com/admin/structure/types/manage/yourtype/display) where you have a link field/fields. In the format column for the link field that you want to use this formatter, select the 'Service icon (with options)' format and save the form to put it into use.
Click the settings cog/gear button to view and edit the (hopefully) self-explanatory options for how the links should be displayed. These exploit most of the Font Awesome features.
To customise the icons further, just theme your pages as usual. With the icons rendered as text characters using Font Awesome, you can style them with CSS as you wish.
Thanks
Thanks to Bobík (bobik) who published a sandbox project which was the starting point for this module.
The icons are from the Font Awesome project, by Greg Loucas and Dave Gandy.
The font has been made available to Drupal in the Font Awesome Icons module by Rob
Loach (RobLoach) and Inder Singh (inders).
Git Clone Link
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/natts1/2287455.git
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 2287461-link_icons_ui_string.diff | 5.32 KB | leewillis77 |
Comments
Comment #1
nattsComment #2
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxnatts12287455git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
nattsNow reporting no errors/issues: http://pareview.sh/pareview/httpgitdrupalorgsandboxnatts12287455git
Comment #4
nattsComment #5
leewillis77 commentedAutomated review
PAreview is clear as per previous comments.
Manual Review
Duplication
The project title seems to similar to the existing linkicon module: https://drupal.org/project/linkicon. While that module does something different, you should consider a name change to avoid future confusion between link_icons and linkicon.
README.txt
The README file is nice and clear, but doesn't follow the (Admittedly not very firm guidelines - https://drupal.org/node/447604. Consider following the styles set out in that link for headings and bullet points.
I installed the module, and gave it a try. I've attached a patch which makes some changes to the strings in the UI to make the capitalisation consistent with other fields on the "Manage display" screens.
Comment #6
nattsThanks for the review Lee. I have now updated the README to the newer template, and included your patches for UI consistency.
I admit I was unaware of the Linkicon module until now, but I would like to stick with 'Link Icons'/'link_icons' for the name/URL as they best describe what the module does (provides icons for links).
Comment #7
leewillis77 commentedThanks natts,
I'm going to leave as "Needs Review" as I'm not sure on the policy around potential naming conflicts - other than that I'd be happy to mark as RTBC - hopefully someone else will review either flip the switch - or clarify.
Comment #8
ruslan piskarovHello natts.
It seems to me that it
/**
* Field formatter for Link field.
*
* @file link_icons.module
*/
can be replaced to that
/**
* @file
* Field formatter for Link field.
*/
String 246:
The $inverse variable might have not neeb defined.
String 256:
"_blank" - Can you use single quotes?
String 287:
The $text variable might have not neeb defined too. If case is default.
Thanks.
Comment #9
tregismoreira commentedManual review
link_icons.module file:
Also, none of the items previous identified by Ruslan was resolved.
Good work! ;)
Comment #10
howto commentedMissing git clone command in your issue. Please provide a git clone command.
Comment #11
howto commentedManually review.
Line 43, 111, file link_icons.module, function link_icons_field_formatter_settings_form()
You should use property #empty_option, #empty_value to add empty option to select element.
Line 81, file link_icons.module function link_icons_field_formatter_settings_form().
Notice: Undefined index: fixed-width in link_icons_field_formatter_settings_form() (line 81 of .../sites/all/modules/contrib/link_icons/link_icons.module).
Setting name fixed-width is not defined in hook_field_formatter_info().
[Optional] Line 40, 54, file link_icons.module, function link_icons_field_formatter_settings_form()
String "if any" should have same style with the other. "if any" vs "(if any)"
Comment #12
nattsThanks for the comments Ruslan, Tregis and How to. I've now updated the .module file accordingly, and added the git clone command to the issue summary.
Comment #13
nattsAdded spotlight.com service
Comment #14
partyka commentedAutomated Review
This is from drush dcd
FILE: ...P/htdocs/drupal7/sites/all/modules/contrib/link_icons/link_icons.module
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
3 | ERROR | The second line in the file doc comment must be " * @file"
4 | ERROR | The third line in the file doc comment must contain a description
| | and must not be indented
--------------------------------------------------------------------------------
Manual Review
Comment #15
miroslavbanov commentedHi natts,
Thanks for the contribution. This is a nice module that serves a very useful function.
No need to repeat the previous review. The only problem there is that
link_icons_field_formatter_view()could use a few comments. But this is not such a major issue that should prevent the project from being promoted.A suggestion
I would recommend having a way for other modules to add additional sites without hacking the module code. For instance, in
link_icons_field_formatter_view()you could do:And you could return your services from implementing the same hook:
But this is a suggestion, and not a problem you must fix. The only blocking issue, in my opinion, is to fix the PAReview errors.
Comment #16
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #17
nattsFinally got around to fixing those small issues and updating the code as suggested.
Comment #18
miroslavbanov commentedI see that the corrections are made. I see a small problem that the function link_icons_link_icons_services doesn't have comment. I suggest to change it to:
I think this is good enough to be promoted. It already had very minor issues previously, so I think this is overdue. Thanks again for the nice contribution and effort.
Comment #19
nattsThanks Miroslav, I'll make that change shortly. Just waiting to get my Git status upgraded then :-) https://www.drupal.org/node/539608
Comment #20
nattsComment #21
ayesh commentedHi Natts,
Sorry about the delay in reviewing your application. I'm assigning this to myself to take a final look and then I will go ahead with the application process :)
There are few modules that provide similar functionality. The most similar ones are:
- https://www.drupal.org/project/link_favicon_formatter
- https://www.drupal.org/project/linkicon
They have slightly different functionality, but linking to them and explaining the differences will make it easier for others.
Comment #22
nattsThanks Ayesh - I have updated the description.
Comment #23
nattsHi Ayesh - any news/progress?
Comment #24
cweagansThanks for your contribution!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.