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.
When Entity View Mode creates a custom view mode, it sets array('custom settings' => FALSE);
. (line 102 in entity_view_mode.module)
This keeps it from showing up in the sub-menu under Manage Display even after it's enabled under Custom Display Settings.
Should an option be provided when you create a View Mode so you may toggle if Custom Settings should be true/false?
Comment | File | Size | Author |
---|---|---|---|
#8 | entity_view_mode-missing-menu-rebuild-1274478-8.patch | 1.28 KB | Alumei |
#5 | entity_view_mode-missing-menu-rebuild-1274478-5.patch | 1.23 KB | Alumei |
Comments
Comment #1
djalloway CreditAttribution: djalloway commentedComment #2
mansspams CreditAttribution: mansspams commentedEven if I set 'custom settings' to TRUE I cannot seem to be able to get custom view mode to show up in UI. I remember I was annoyed by this year ago and now again :)
Comment #3
semiaddict CreditAttribution: semiaddict commentedDon't forget to activate the newly added view mode.
To do so you need to go to admin/structure/types/manage/[node-type]/display and check the corresponding box under "Custom display settings"
Comment #4
mesr01 CreditAttribution: mesr01 commented...and also most probably clear the (menu?) caches to display the corresponding local sub-tasks.
Comment #5
Alumei CreditAttribution: Alumei commentedI've done some testing and indeed the menu needs to be rebuild after adding or deleting new view modes.
This has to be done, as the local tasks for display editing are generated on menu rebuild. The task are then hidden, based on the 'custom settings' value.
The included patch is against the latest 1.x version and includes calles to menu_rebuild on view-mode saving and delition. That solved the problem for me.
Comment #6
Alumei CreditAttribution: Alumei commentedSorry I forgot to set the Issue Status.
Comment #8
Alumei CreditAttribution: Alumei commentedSeems my patch was against the wrong module version. So here again:
Comment #9
Alumei CreditAttribution: Alumei commentedAnd again i forgot to reset the Issue Status. -_-
Comment #10
tomogden CreditAttribution: tomogden commentedThis tests out well on two of my sites. I did have to manually clear the menu cache, since my menus were already incorrect, but adding and removing view modes worked fine after that.
Comment #11
Alan D. CreditAttribution: Alan D. commentedDoes the trick nicely. I have lodged a bug report about this in core, but it has had no attention and is now lost in with the other 6000 or so issues...
As per #10, this is ready to go. Since these are atomic operations, no needed to flag the menu rebuild imho, the only possible sticky point. Bumping to major as non-developers would normally not know this and it removes any useful functionality.
I want to start promoting this from the Read More Control project page, as this now adds support for controlling the Read More link from any view mode on any entity that supports entity_url() or entity_label(), and afaik this is about the only module out there that does this.
Comment #12
Dave ReidThis is now fixed with http://drupalcode.org/project/entity_view_mode.git/commit/eb0c03b