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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

djalloway’s picture

Title: custom settings » view mode 'custom settings' set to false by default
mansspams’s picture

Title: view mode 'custom settings' set to false by default » View mode 'custom settings' set to false by default

Even 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 :)

semiaddict’s picture

Don'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"

mesr01’s picture

...and also most probably clear the (menu?) caches to display the corresponding local sub-tasks.

Alumei’s picture

most probably clear the (menu?) caches

I'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.

Alumei’s picture

Status: Active » Needs review

Sorry I forgot to set the Issue Status.

Status: Needs review » Needs work

The last submitted patch, entity_view_mode-missing-menu-rebuild-1274478-5.patch, failed testing.

Alumei’s picture

Seems my patch was against the wrong module version. So here again:

Alumei’s picture

Status: Needs work » Needs review

And again i forgot to reset the Issue Status. -_-

tomogden’s picture

Status: Needs review » Reviewed & tested by the community

This 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.

Alan D.’s picture

Priority: Normal » Major

Does 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.

Dave Reid’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.