Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 ?
Comment | File | Size | Author |
---|---|---|---|
#8 | rabbit_hole-field_collection_support-1878444-8.patch | 3.74 KB | Pere Orga |
Comments
Comment #1
olofbokedal CreditAttribution: olofbokedal commentedNot sure what you mean about duplicated content. What you want, is to redirect the user to the main node if he's viewing a field collection entity?
Comment #2
pedrospField collections for my purpose are merely a piece of content of a master node, that's why I don't want them to be visible and searchable outside the master node. That's exactly what Rabbit hole module is aimed for, but it is not possible to handle field collections.
For the record, I walk away from field collections because it lacks some other entity integrations like entity translation.
Comment #3
olofbokedal CreditAttribution: olofbokedal commentedBecause of the hook system that Rabbit Hole is based on, it should be quite easy to extend it to cover Field Collections. I'd imagine that there are more sites that are using Field Collections in the same manner as you used to, so I'll look into this in a couple of weeks.
Comment #4
BBC+1 for extending this module to include field collections
Comment #5
Pere OrgaHey, I'm also interested on this.
Did you get any far implementing it?
What I don't see is where the display settings would be. Field collections are entities but have a "field" behaviour; they don't have a "edit Field collection" page, just "manage fields" and "manage display".
Comment #6
olofbokedal CreditAttribution: olofbokedal commentedNo, I haven't done anything regarding this issue yet.
Didn't think about the difference from a "regular" entity. If the only pages are "manage fields" and "manage display" I can't think about a good location from the top of my head.
Please feel free to keep posting and researching :)
Comment #7
olofbokedal CreditAttribution: olofbokedal commentedThis is some tricky business. The most logic place to put the settings would be among the field settings for the Field Collection field. But I'm not sure it's possible to store the Rabbit Hole settings in the same manner as for other entities.
Comment #8
Pere OrgaHi again.
I'm attaching a patch that adds rh_field_collection module. It is based on rh_node module and for my tests everything is working as expected. I followed your idea of inserting the Rabbit Hole settings in the field settings page.
Comment #9
Pere OrgaI've added the module in a sandbox too: https://www.drupal.org/sandbox/netol/2362931
Comment #11
olofbokedal CreditAttribution: olofbokedal at Odd Hill commentedThanks! This has been committed to 7.x-2.x.