Use tac_lite to hide node content but not title

henns20 - September 6, 2008 - 21:23
Project:Taxonomy Access Control Lite
Version:6.x-1.2
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:by design
Description

I played around with the module just wondered if there was a feature to:

  • allow people to see the node title in view lists but not be able to access the node
    • i.e. For events using to taxonomy and taxonomy lite to restrict people to view node details(node view) of the event. Why? Serves to allow non-members to a club to see activity in a club - but incentivizes them to sign up to see the details

Jamie

#1

Dave Cohen - September 7, 2008 - 14:48
Title:Great Module One Question» Use tac_lite to hide node content but not title
Status:active» by design

For this sort of thing you have some options like the premium content module. Or, create your own content type and implement hook_access with the logic you need.

There's no feature like this in tac_lite.

#2

henns20 - September 7, 2008 - 21:11

Well - I have used the content_access module which seems to have this behavior by default...but this is more of a taxonomy access need. Reason being for content pieces like a forum and event content types....you really can only have one content type for these... Thanks for the suggestions.... I will check out the premium content module...

My sense is that you don't see it as a easy feature to add if one wanted to... if i got a sense that it would be a straight forward addition to this module to have that feature...i was thinking about trying my hand at doing it...

#3

Dave Cohen - September 8, 2008 - 15:45

Drupal has two mechanisms for access control. One is the node_access table in the database. This table can be joined in SQL queries so that hidden content is completely hidden. For example, never showing up in views.

The other mechanism is hook_access, where PHP code can define logic to allow or deny a user to view or edit content. One drawback with hook_access is that it's available only to modules which define a content type. So third-party modules have trouble using it.

tac_lite uses only the node_access mechanism. I don't think it should do any more than that because (a) it would be less lite, and (b) I don't think there's much need for viewing the title without accessing the node (more people would consider it a bug than a feature).

There may be other modules that do just what you want. Or, you could write your own module with a hook_nodeapi that does what you want.

#4

henns20 - September 8, 2008 - 16:00

great response - will look at other routes - not a must right now thanks:)

#5

carlclancy - November 21, 2008 - 16:18

I really need this feature!

Would it really make the module much less "lite"? I can imagine it's fairly common that someone would want to be able to show a list of premium content without granting access to it.

Either way, great module Dave.

#6

JStarcher - March 4, 2009 - 04:17

I've created a patch that will give out the title and teaser but nothing else. The nodes are also viewable in Views when you enable the new option. It requires a core patch but there wasn't much I could do. The core patch just adds hook_access to the nodeapi, nothing crazy.

AttachmentSize
hook_access.patch 4.62 KB

#7

JStarcher - March 4, 2009 - 17:02

Had a spelling error if anyone is worried about it attached is the corrected patch. Also didn't realize this ticket was talking about the 5.x version, my patch is for the 6.x version.

#8

JStarcher - March 4, 2009 - 17:03
Version:5.x-1.2» 6.x-1.2
Component:Miscellaneous» Code
AttachmentSize
hook_access.patch 4.62 KB

#9

Gabriel Radic - April 26, 2009 - 16:16

This looks useful, hope it'll make it into Drupal itself.

 
 

Drupal is a registered trademark of Dries Buytaert.