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.
Problem with custom view modes and features
When i revert my feature containing the DS view modes and configuration someting strange happens:
1) View modes are created but not active for the content types i used them for
2) When i activate them manuel for the content type (Use custom display settings for the following view modes ), drupal knows my settings and everything is like i wanted
Am i forgetting someting in my feature, working in team with clean installs so i need to get this right
Thanks
Comment | File | Size | Author |
---|---|---|---|
#1 | Screen Shot 2011-10-20 at 17.25.00.png | 31.83 KB | michiellucas |
Comments
Comment #1
michiellucas CreditAttribution: michiellucas commentedComment #2
swentel CreditAttribution: swentel commentedView modes are configured through a variable called 'field_bundle_settings' - that's core handling it, so you need to export that variable as well.
Comment #3
msbrar CreditAttribution: msbrar commentedWere you able to achieve this. Although i did export field_bundle_settings and i see the settings in the include file, i can still not see them in the site. Somehow, the settings seem to be overriden.
EDIT: This worked for me with the solution described by clearing the caches.
Comment #4
hedley CreditAttribution: hedley commentedA great feature would be to be able to export the view mode settings per content type
Comment #5
Cyclodex CreditAttribution: Cyclodex commentedI also have this problem after exporting and importing the whole database. Strange that the displays are not activated. Looks like I have to enable them again.
But why are they not on after complete copy of database? Isn't that saved in the DB ?
Regards
Comment #6
Elijah LynnThis is working now in case anyone comes across this. You do have to clear cache to get it to work though as suggested above. I tried field_bundle_settings_user__user to get my active view modes exported but it didn't work. Then spent a few hours on different variables and finally came across this and gave it another go with a drush cc all (cache clear). Works great now!
Comment #7
Cyclodex CreditAttribution: Cyclodex commentedThen this would be cool if this information could be shown somewhere or a dependency could be set. I am not sure what is possible in features, but wanted to note it down here for now. Will also test this the next time I need this. Thanks so far.
Comment #7.0
Cyclodex CreditAttribution: Cyclodex commentedScreenshot won't upload so i added info text
Comment #8
dman CreditAttribution: dman as a volunteer commentedIf not clear for searchers (like me) - the solution is to add strongarm.module
With that on, the additional (core) settings needed are autodetected and become part of your feature.
For a 'news' content type, these additional settings became available from core:
The first one was the key for getting enabled 'view_modes' to deploy.
Comment #9
Nikhil Banait CreditAttribution: Nikhil Banait at QED42 commented#8 worked for me. Thanks.