Download & Extend

Removing or Altering /field-collection Paths

Project:Field collection
Version:7.x-1.0-beta4
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

hi, it is possible not created internal paths like /field-collection/field-name/id?
or at least block access to external users, if possible.

Comments

#1

Title:i wouldn't the path item /field-collection» Removing or Altering /field-collection Paths

I'd also like an option to disable these paths, though I would suspect being able to alter them could be useful as well. Perhaps with path auto at some point too?

I've only been able to disable these paths via a custom redirect/404 module I use on a per site basis. That's working well enough so far! My primary worry was in having SEO related issues.

#2

I am also interested in a UI for paths field collection items. Anything in the near future? Or if you can give me some pointers, I can try to roll out a patch for the same.

#3

I presume that duplicated content generated by the field collection view and the source node is obviously bad for SEO purposes.
I use to deal with the Rabbit Hole module to avoid duplicate content, however I can't figure out how to use it with field collections.
Anyone has a related experience ?

#4

Yep, I rejected from using this module after discovering this unwanted "feature" in favor of "Field group" + "Fieldgroup multiple".

#5

I also wish I could easily do something else with these paths. I wanted to continue using field-collection, so here are two quick hacks I found for this in the meantime, in case anyone else is interested:

1) Block access to users:
http://drupal.org/node/1282066
I just did a quick test of this by adding the content to field_collection_menu_alter. Appears to work as intended.

2) Redirect the pages. This is a very broad redirect added to Drupal's .htaccess file. Should be placed above the index.php redirect section (section that ends with "RewriteRule ^ index.php [L]").

# Redirect field-collection to index

RewriteCond %{REQUEST_URI} ^/field-collection
RewriteRule ^ index.php [R=301,L]

If your Drupal installation is in a subdirectory, change RewriteCond:
RewriteCond %{REQUEST_URI} ^/<subdirectory>/field-collection

Or just redirect one collection...
RewriteCond %{REQUEST_URI} ^/field-collection/field-<fieldname>

Typical disclaimer here: only tested on my own server, test well before using in a production environment, etc.