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.
I was tinkering around with service_links and came up with this. It would allow defining service links from a customization module, instead of having to modify service_links.module directly. Thoughts?
Comment | File | Size | Author |
---|---|---|---|
#11 | service_links-185642-2.patch | 9.45 KB | skilip |
service_links_centralize.patch | 17.17 KB | bdragon |
Comments
Comment #1
greenSkin CreditAttribution: greenSkin commented+1 to adding this to service_links or some variation there of.
Comment #2
liquidcms CreditAttribution: liquidcms commentedi added a service link hook patch a few months ago: http://drupal.org/node/189264
is this the same thing?
Comment #3
dwwI marked #189264: should have a hook to add links duplicate with this, but there's another (much smaller) patch there that could be considered as an alternative to this:
http://drupal.org/files/issues/add_hook_01.patch
Comment #4
wayland76 CreditAttribution: wayland76 commentedIt might be an idea to have Service Links depend on WIJI: http://drupal.org/project/wiji (which would allow the addition of extra service links). There'll be a dev version out of wiji at the next packaging script run.
Comment #5
dww@wayland76: I think optional integration with wiji might be nice, but a full-blown dependency is not a good idea. Service links is a (relatively) simple module that does what it needs to without too much hassle. Requiring everyone who wants this functionality to define a wiji page for their site and enable yet-another-module sounds like an unnecessary complication and barrier for users who just want to add a few service links to the well-known bookmarking sites to their pages.
Comment #6
wayland76 CreditAttribution: wayland76 commentedHmm. Well, maybe wiji hasn't been explained properly (but you're probably right about optional integration). Installing wiji would, admittedly, be necessary, but the WIJI definitions should (hopefully) be made by the service-linked websites (ie. Google, Facebook, Reddit, etc), rather than the individual users. If the search engine added a WIJI page, then it would be possible to just go into WIJI, enter the search engine's front-page URL, and then everything would work.
So, for ordinary users, it would look like this:
1. Install wiji
2. Install Service Links
3. Enter URL of any wiji-enabled site into WIJI module
4. Everything works
And, as the WIJI page mentions, the site wiji.jdarx.info will contain information for any major sites that don't implement WIJI. This happens to include the complete list of sites that the Service Links module currently supports.
Comment #7
joachim CreditAttribution: joachim commented+1 for bdragon's patch.
Centralizing the links means fewer rows in the variables table, makes this module's code a LOT simpler in two places, makes it easier to update the details for sites in future should URLs change.
We should leave discussion about WIJI aside for now, or take it to another issue.
Comment #8
jwilson3+1 for bdragon's patch.
I've been thinking about how cool it would be to have a module that handles on-the-fly (but cached of course) css sprite generation for the service link images. Setting up a hook_service_links opens the door to lots of cool implementations of service_links like this.
Comment #9
TheCrow CreditAttribution: TheCrow commentedA modified version of this patch is included into the 2.x branch
Comment #11
skilip CreditAttribution: skilip commentedHere's a patch against the latest version which allows other modules to alter the $links array before passed to the node links array.
Comment #12
TheCrow CreditAttribution: TheCrow commented2.x branch already implements callback mechanism!