Active
Project:
Block reference
Version:
7.x-2.2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2015 at 19:01 UTC
Updated:
4 Mar 2019 at 06:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
R.J. Steinert commentedThis is Bean centric, but something like the attached patch.
Comment #3
R.J. Steinert commentedHere's another version of that patch. It removes some cruft and uses a consistent method for getting available view modes.
Comment #4
R.J. Steinert commentedHere's another version of that patch. Less cruft again.
Comment #5
rudiedirkx commentedIf it requires Bean, it's not a patch, but a separate module. Standard blocks don't have view modes. Beans are entities. Why not use Entity reference?
Comment #6
R.J. Steinert commentedAll good points and we could certainly make this a separate module. I believe that the issue with using entityreference module is that sometimes the editors want to reference a Bean Block, other times they want to reference a View Block. Utilizing this patch we get Drupal closer to giving editors an MVC like experience. The blockreference field becomes a Controller that editors use to combine a Model (the Bean Block) and display it with a View (the View Mode) of their choice. If an editor wants to include a Collection View, they use the Views module as the Controller that manifest itself as a Block that contains a Collection of Models (the Filter options), the Collection View (the Style plugin chosen), and the Item View (the View mode chosen for items).
Ultimately I would like to see a workflow as follows...
1) User selects View, maybe referred to as Widget which is generated from a list of Style plugins and View modes.
2) User adds View specific configuration (ie. sort order in the case of a Table).
3) Given the type of Widget (Item View or Collection View), user is asked what Model or Models to place in the View.
That's just an idea at the moment, for now I think this patch (or separate module) could be improved by only displaying the View Mode select if a Bean is selected.
Comment #7
rudiedirkx commentedWow, you're using the term MVC very flexibly =)
Since the view mode is part of the spefici field item, not the global formatter config, it's slightly harder to make it a separate module. I missed that before. You'd need a custom widget, custom formatter and alter the schema.
Some patch code review:
module_exists('bean')in there.I'm very curious to see your end product. If it's well done and unobtrusive, I might patch it, but a separate module is the safer bet.
Comment #8
oskar_calvo commentedHello,
I'd like to know what happens with this patches? Can be used or they required more code?
Thanks.
Oskar
Comment #9
romixuaComment #10
romixuaComment #11
romixuaComment #12
romixua