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 don't think we should be providing the print view mode for all entities but in the case of field collections it might make sense. That being said i think there are three areas where this could be implemented
1. Custom module
2. Print module
3. Field Collection module
Below is the relevant code so if it is decided that this is a worthwhile feature or if someone needs help it is in the record.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1741612-print-view-mode-field-collections.patch | 507 bytes | pirog |
Comments
Comment #1
pirog CreditAttribution: pirog commentedHere is some code to do this in a custom module
Comment #2
pirog CreditAttribution: pirog commentedhere is a patch to the latest 7.x-2.x-dev branch in case people want to do that instead
Comment #3
jcnventura CreditAttribution: jcnventura commentedThanks for the patch!
http://drupalcode.org/project/print.git/commit/0122e31
Comment #4
jcnventura CreditAttribution: jcnventura commentedOne question, to fago or pirog: Considering that the 'print' view mode is part of the core book module, why is the above patch needed?
Comment #5
pirog CreditAttribution: pirog commentedIf book has a print view mode also then i guess the real question would be not why this patch implements a print view mode for field collections but why this module does so in general. The purpose of the patch was just to extend the print view mode already provided by this module beyond just node and to field collections as well. Maybe we should consider removing the print view mode from this module all together?
Here are some additional thoughts:
I am not super familiar with book... but is "print" in the book module intended to provide the same kind of use case as the one in this module, ie to determine how an entity is to be displayed for "printing"? If they provide different use cases then i think we should probably rename the one provided by this module.
If they provide the same use case then we would probably just want to have this module check to see if book is enabled and if not then provide the view mode itself?
Comment #6
pirog CreditAttribution: pirog commentedSo here is what is in both Print and Book
Print:
Book:
So if the use cases are the same would we want to just add a check to see if book is not enabled for Print's implemention? The field collection patch could then stand since it probably doesn't make a ton of sense to put it in book but ive seen crazier things... such as on the 71L bus this morning.
Comment #7
jcnventura CreditAttribution: jcnventura commentedIs a check for the book necessary? I think it just overwrites it with the same info, anyway...
Comment #8
pirog CreditAttribution: pirog commentedYeah if there are no namespace collision issues to worry about then i am all for keeping it the way it is.
Comment #9
jmuzz CreditAttribution: jmuzz commented