Hi everyone, Ive got an issue that keeps coming up but Im not sure how to handle it. It seems like it should be a fairly typical concern at least for relatively new Drupal users.
Heres an example:
Suppose I create a new "Image" content type. Then I use views to create a gallery with thumbnails and a lightbox type module to see larger versions of each image (imagecache presets, etc...). Im not really creating a link to each image node since the links I create in my view just open up the lightbox but... I know Drupal has created the actual node and Id rather not let that be visible to anyone (I havent even spent the time to actually style that type of node to make it look good on its own). I only want the images to be seen in the gallery.
Heres another:
I create an FAQ page with the FAQ module. It creates a new content type: FAQ which stores each question+answer. It also allows me to create taxonomy terms to organize my FAQs on the the FAQ page. The downside: Drupal automatically creates a page at taxonomy/term/3 (for example) where all FAQs in that category can be seen AND each FAQ is clickable and takes you to each full question node.
What are our options here?
This is something that worries me a bit since Drupal frequently creates content at URLs that I may not remember -or even realize- exist. Obviously we need the nodes for our functionality but we dont always need each node to be created as an actual page on the site.
Ive been looking around and the only -partial- solution I see for this kind of stuff is telling search engines not to index the nodes (robots meta tag, robots.txt) I dont want to be seen and also using .htaccess or a module to redirect from those nodes to somewhere else... Is that basically the only solution right now?
Thanks ahead of time for any info on this!
Comments
I know this isn't exactly your question...
But given that lightbox is a javascript effect, and not everyone has javascript enabled - lightbox should degrade by showing the page instead. I wouldn't hide access to those pages directly for this very reason, and unfortunately, you might want to do some basic styling to those pages.
I don't think the search engine solutions are truly viable solutions, not from an obfuscation standpoint, but simply in that I have had plenty of issues with search engines not respecting these rules. Here are a couple of more solutions that might help though.
http://drupal.org/project/taxonomy_access
http://drupal.org/project/nodeaccess
I agree search engine solutions are not enough to hide pages Dru
Hi, thanks for your reply. Actually, since the lightbox link points to the actual image it has to show, and not to the actual image node, it degrades gracefully by showing the JPG image in the browser. No problem there since the graceful degradation is completely independent of the image node.
I agree with you on the fact that the search engine solutions are not enough. Just the other day I checked a couple of nodes that Im trying to not index by using the appropriate robots meta tag, etc. but a couple of them got indexed so its obviously a far from perfect solution. Ill check out the modules you suggest. My worry though is that any module which establishes permission type rules will hide the nodes no matter how I want to output them. All I want to do is hide the full node page and show the node (or parts of it) through other methods such as views.
3 possible methods to hide unwanted node pages
OK, Im going to try to tackle the image node issue first.
I tried the node access method and it doesnt work. The problem is that if you use perms to tell Drupal not to show image nodes to anonymous users, it doesnt show the actual node page (good) but it also wont show the node in any view where you call on it (bad).
So, at the moment I can think of 3 other possible solutions. It would be nice if someone experienced out there could give us some input on what the best way might be or other alternatives.
Method 1 (the unpublished method)
Downside: What if you want to create an image node today but not show it on the site until next week?
Method 2 (the template redirect method)
Method 3 (the module redirect method)
In not sure how tha last 2 methods would affect SEO, but probably not too well I would imagine.
comments on method 3
As for method 3, I tried to use the Path Redirect module to send "taxonomy/term/1" to, for example, the front page. I got an error: "You cannot create a redirect from a currently valid path" which led me to a post that looks interesting (http://drupal.org/node/615008):
If I try redirecting from image nodes to another page I get the same error when trying to redirect from the node path "node/id". And if I try to redirect from alias "photo/id" I get this error:
"You cannot add an existing alias as a redirect as it will not work. You must delete the alias first."
I guess Ill have to try Global redirect...
_
Hello Elsuertudo,
I had the same concern for a long time now and decided to post an issue about it. (http://drupal.org/node/685862) After I posted this issue I found your topic. Unfortunately not too much response yet. I first used Method #1 as described by you.
Now I'm experimenting with the Rules-module (http://drupal.org/project/rules) and I think that is the way to go. You can keep your image-node published and shown in a 'view'. If an anonymous visitor would navigate to your image at for example: /image/photo-1 , he/she will be redirected to wherever you want. For example to /image , where your 'view' might be.
The good thing about the Rules-module is that you can import and export your rules, so this gives me the opportunity to give you a sampler of my redirect rule... :) It's for a content-type called 'events' which I want to be shown in a 'view' but not as a node.
You were experimenting with redirect based on the url of that node. Rules can redirect based on the content type, which is a bit more solid way to use i find. Path's can change, node-types don't.
Hope this is helpful.
Cheers,
Danny
THANK YOU! Thats a great
THANK YOU!
Thats a great idea! Better than anything I came up with. Youve made my day. Actually, robots.txt is working fine for me now but I still dislike the idea of nodes I dont want shown just hanging around so Ill definitely be using this fine trickery.
Keep up the good work!
Effect on SEO?
Seems like a great idea Danny! The one downside might be that the action rules_action_drupal_goto likely uses the default drupal_goto API call, which redirects with a 302 (Found), whereas I think 301 is preferred for SEO.
http://api.drupal.org/api/function/drupal_goto
Even 303 (See Other) might be better...
Anyhow, just saying that it might not be a perfect solution yet, but great idea! :)
_
Hi Patcon,
Tnx for your thoughts. I'm not very experienced with SEO yet. (I ordered the seo for drupal book last week and it's on it's way :) But a 301 sounds like it would make sense indeed.
Maybe this could even be a small module? One where you have to check or uncheck different content types which will turn into 301 errors when viewing them. Or would that be a redirect as well? A redirect from content type to 301? I have no idea about this.