Needs review
Project:
Service links
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 May 2012 at 14:53 UTC
Updated:
25 Jul 2013 at 18:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gemalmI did the following and it works. In the option "Show Service Links on specific pages", I have selected the option "show if the following PHP code returns TRUE" and I add the following code:
Comment #2
TheCrow commentedThanks @gemalm, added also here: http://servicelinks.altervista.org/?q=about/troubleshooting
Comment #3
chiebert commentedI'm coming here from #2009828: Add option to hide for pages that are not normally visible to anonymous users, where my original issue was also caused by the need to hide service links on private Organic Groups content in the 7.x branch. The PHP filter snippet approach in #1 is a bit problematic, especially for OG in D7:
Instead, I suggest we use the Drupal-version-specific version of node_access(), with a user-configurable switch on the admin settings form analogous to the 'hide for unpublished content' check. The attached patch for 7.x-2.x adds this setting in service_links.admin.inc:
... and then adds a check in function service_links_show(), in service_links.module:
This is working well for me, but would need to be backported to 6.x.
Comment #4
simon georges commentedMoving to "Feature request".
Comment #5
simon georges commentedDue do the diversity of Drupal modules, it's kinda impossible to evaluate whether the node is public or not (since you can have temporary public node, special codes, GET parameters, ...), so I don't see how this can be build into the module.