views:

26

answers:

1

I have seen many somewhat similar questions, but nothing quite what I'm looking for. So at the risk of being told this is a duplicate... here it goes.

I've found that there are times I have a node that simply contains content that will be displayed somewhere else, but shouldn't be viewed directly. That is, no one should ever go to node/1234, but the content in node 1234 should be displayed somewhere else. For example, I create an about page with tabbed content using views. So there are "About Me", "About Us" and "About Them" pages. All of these are displayed in a single page with tabs using Views. So I don't want people to get directly to the "About Us" node because then they wouldn't see the tabs for the other pages. At the same time, I don't want Google giving people a direct link to this node, I want to limit access so users can only get to it through the View (i.e., the tab).

So I need to restrict access to the node, remove it from the Drupal search results, and make sure Google doesn't pick up on it. Any suggestions?

---- Note ----

I've accepted the answer from mingos (thanks btw) because even though it's not a full answer / solution, it gave me some good things to think about. Additional answers are still welcome.

+2  A: 

Tough one.

If you want to have many nodes like this and do the "displaying elsewhere" dynamically, I can't think of anything right now (at 2:20 AM I rarely can).

If there is onne such page (or very few), I'd restrict access to it by any available means (Permissions, Nodeaccess, Content Access, TAC, whatever) and then create special themes for the pages where the restricted content should be displayed. The themes would contain database queries, fetching content from the restricted nodes.

Other possibility might include creating a special theme for the hidden nodes in question (perhaps all belonging to the same content type?). Make full node display nothing (or a message saying the access is restricted) and add a ROBOTS meta tag asking Google not to index the page. Make the teaser view available though - you can display it freely inside a view, but since /node/1234 is the FULL view, the actual content will be unavailable here.

Dunno if this solves your problem, hope it helps at least a bit.

mingos
Thanks mingos, it certainly is a tricky one. There aren't too many instances where I want to do this, so manual stuff is possible, but obviously creates maintenance nightmares. Unfortunately it might not be restricted to a single content type, or even all nodes of a given content type, which makes it even trickier.
Chaulky
Agree with the solutions @mingos has come up with. You can change your robots.txt file to exclude those URLs from search engines. Also you can make a special template file for those nodes which will show nothing when accessed.
Sid NoParrots
Yes its definitely something to consider, though I'd love a more maintainable solution. This doesn't mention hiding it form the Drupal Search (which I realize I kinda left out of the question, will edit), but there seem to be some decent posts about that topic.
Chaulky
Out of curiosity: why would you do that anyway? Is there some reason behind hiding nodes, but displaying their content elsewhere?
mingos
Yes, I feel there are times I want to display content only in the context of other content. For example... a movie review. Yes, you could display it on it's own and link back to the movie. But say I want to display all the reviews in a tab on the Movie's page. If you show the full review there... why also display it on it's own page? It's mostly about controlling user experience and making sure they see things in the way I want them presented.
Chaulky