Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

How to restrict direct access to the nodes but just allow views to access the required field of the particular node type, for example in views slide show we are sliding the image field belongs to particular node type. But we don't want search engines to access & visitors to access the nodes belong to that node type

share|improve this question
add comment

migrated from stackoverflow.com Sep 11 '11 at 5:11

This question came from our site for professional and enthusiast programmers.

4 Answers

A simple solution would be to not publish the nodes you don't want to be accessible. Views can still pull the data from those nodes.

share|improve this answer
    
thanks bro it's too simple solution. –  Fahad Sep 11 '11 at 6:46
1  
Too simple? There is no such thing as a 'too simple solution'. Complexity isn't a goal in itself, is it? Perhaps Googletorp's answer doesn't solve your specific problem, but in that case you will have to be more elaborate and explain why not. –  marcvangend Sep 11 '11 at 8:19
    
+1 Great solution.. –  Sachin Shekhar Sep 14 '11 at 4:26
    
@marcvangend Though it's late but I have realize that is not the answer of my question. Hope some one can add a better answer –  Fahad Dec 8 '12 at 22:31
    
@Fahad To get better answers, you need to ask better questions. Googletorp's answer looks like a good solution to me, and the upvotes seem to agree. If it doesn't solve your problem, go in and edit your question, adding all relevant details. –  marcvangend Dec 9 '12 at 7:46
show 7 more comments
up vote 2 down vote accepted

If we unpublish nodes added by user1 they wont be editable by any other user even if the user have the rights to edit the content of that content type.

Restrict Node Page View seems a better way to restrict the direct access to any nodes of specific content type.

Usage is also fairly simple you just need to enable this module and configure the permissions for the nodes which are directly accessible as normal.

http://drupal.org/project/restrict_node_page_view

Have you ever used a slideshow nodetype that you need to be published but don't want the node be accessible by itself using then node/XXX path? This module is for you!

With this module you can disable direct access to node pages (node/XXX) based on nodetypes and permissions.

Enable the module and don't forget to configure your permissions.

share|improve this answer
add comment

An other module who do the same thing but with more functionalities.

Rabbit Hole

Maintainers of this project ask to "Restrict Node Page View" Maintainer to merge projects in issues.

Advantages against "Restrict Node Page View" :

  • Same main functionality on node but extensible to users/files/taxonomy terms
  • Can be used in your module
  • Can be global to content type or on every content
  • See more on project page...

Disadvantage against "Restrict Node Page View" :

  • More code so possibly less effective (need tests, not proved)
share|improve this answer
add comment

you should use node_access(), there are certain options that you can easily implement using hook_node_access(). Implementing node_access() allows you to make a decision as to who can access a node and who can create, delete, edit, or update such a node. Views, however, can still pull data from these nodes whatsoever.

hook_node_access(), node_access()

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.