Internal Nodes

Component ID

1136278

Component name

Internal Nodes

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

20703

Component created

Component changed

Component body

Description

Some content/nodes should never be viewed directly; only visible be through something else such as Views or Panels. This module denies access to node/[nid] URLs while allowing the content to stay published and otherwise viewable.

Use Cases

  • Index all content in search, but 301 redirect content to the correct View/Panel on a different path. Example: A View with named anchors as titles. See this on the demo!
  • Deny the existence of select node/[nid] URLs by returning a 404 instead of a 403.
  • Add an edit link field for each node in a View, then automatically redirect back to the View after saving changes.

Functionality

  • Creates a permission per content type which when disabled denies node view to the specified role.
  • Adds an option to content type edit forms for administrators to select the result of a direct node view.
  • Node view options are Allow, Not Found, Access Denied, and Redirect.
  • Redirect URL/path can use tokens, anchors or $_GET variables.
  • "Denied action setting per-node" in content type settings. Node default is to use content type default.
  • hook_url_outbound_alter() implementation to rewrite URLs of denied nodes to the redirect URL.
  • Simpletests for content type settings, node settings, and hook_url_outbound_alter().
  • Rules integration - Node view denied to user
  • internal-node class on <div> and optional status messages for users with permission to view blocked nodes.

Future Functionality

Create a feature request issue if you need any of this functionality sooner than "the future"

  • Custom Drupal message per-content type or per-node.
  • Rules - Set 'view action'
  • Views - List blocked actions for each node
  • PHP/Hook for redirection location
  • Simpletests for minor features