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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greenSkin’s picture

+1 to adding this to service_links or some variation there of.

liquidcms’s picture

i added a service link hook patch a few months ago: http://drupal.org/node/189264

is this the same thing?

dww’s picture

I 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

wayland76’s picture

It 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.

dww’s picture

@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.

wayland76’s picture

Hmm. 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.

joachim’s picture

+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.

jwilson3’s picture

+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.

TheCrow’s picture

Version: master » 6.x-2.x-dev
Assigned: bdragon » Unassigned
Status: Needs review » Fixed

A modified version of this patch is included into the 2.x branch

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

skilip’s picture

Status: Closed (fixed) » Needs review
FileSize
9.45 KB

Here's a patch against the latest version which allows other modules to alter the $links array before passed to the node links array.

TheCrow’s picture

Status: Needs review » Fixed

2.x branch already implements callback mechanism!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.