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 suppose this could work with any entity. Right now it is specific to node entities but the code is simple enough to be abstracted for use with custom entities. A user interface would have to be established in order to handle custom entities however. I would be willing to accept patches to handle this specific need.
The code assumes 'node' in a lot of places, but it could be updated to use the entity APIs a bit more completely.
Current case, there's no reason why we shouldn't be able to use it on fieldable terms also. Field_collections is also a good example.
But it requires making a bit more use of the D7 abstraction layer. A bit tedious if you don't actually want to use it, but possible and more robust.
Certainly postponed is understandable.
sherakamaCreditAttribution: sherakama as a volunteer commented
Version:
7.x-1.0-alpha1
» 7.x-2.x-dev
The core view mode switching functionality will support any entity now but so far I have only written an interface for nodes. Which entity types would you like to see the view mode switching interface for?
sherakamaCreditAttribution: sherakama as a volunteer commented
Status:
Needs work
» Needs review
@amaisano,
I have pushed up a new module to this project that should give the users a contextual_view_modes option on the form to the latest 2.x development branch. Please give it a whirl.
Comments
Comment #1
sherakama CreditAttribution: sherakama commentedI suppose this could work with any entity. Right now it is specific to node entities but the code is simple enough to be abstracted for use with custom entities. A user interface would have to be established in order to handle custom entities however. I would be willing to accept patches to handle this specific need.
Comment #2
sherakama CreditAttribution: sherakama commentedDo you have any specific entity types in mind or are you talking about expanding this into an API for custom entities?
Comment #3
kaizerking CreditAttribution: kaizerking commentedcan we apply for instance field collections ?
Comment #4
kaizerking CreditAttribution: kaizerking commentedComment #5
dman CreditAttribution: dman commentedThe code assumes 'node' in a lot of places, but it could be updated to use the entity APIs a bit more completely.
Current case, there's no reason why we shouldn't be able to use it on fieldable terms also. Field_collections is also a good example.
But it requires making a bit more use of the D7 abstraction layer. A bit tedious if you don't actually want to use it, but possible and more robust.
Certainly postponed is understandable.
Comment #6
kaizerking CreditAttribution: kaizerking commentedrephrased the title to better represent the issue
Comment #7
sherakama CreditAttribution: sherakama commentedJust dropped a new 2.x-dev version that is expanding support for entity types outside of nodes. Needs some work but its started.
Comment #8
sherakama CreditAttribution: sherakama as a volunteer commentedThe core view mode switching functionality will support any entity now but so far I have only written an interface for nodes. Which entity types would you like to see the view mode switching interface for?
Comment #9
sherakama CreditAttribution: sherakama as a volunteer commentedComment #10
amaisano CreditAttribution: amaisano commentedNeed this for users!
Comment #11
sherakama CreditAttribution: sherakama as a volunteer commented@amaisano,
I have pushed up a new module to this project that should give the users a contextual_view_modes option on the form to the latest 2.x development branch. Please give it a whirl.
Comment #12
sherakama CreditAttribution: sherakama as a volunteer commented