Currently all choices (tabs, blocks, accordion) are hardcoded. Introducing a plugin architecture would allow us provide our own variations and would likely streamline the module code.
I can see two ways to get this done:
- Provide a hook for modules to provide a list of identifiers, labels and theme/render callbacks.
- Rely on ctools to handle plugins. While this adds a new dependency (ctools), imo it would allow for a much cleaner file/code structure.
I'm in favor of option 2, but I'll be happy to provide a patch for either one. Thoughts?
Comments
Comment #1
ciss commentedComment #2
chi commentedI think it's possible to alter those widgets without providing extra hooks. I suppose we should create an example.
I believe we don't need implement ctools plugins for such a small module.
Comment #3
chi commentedComment #4
ciss commentedNope, not to the extend that's required for our current project. One of the hardest parts is the Javascript that makes a lot of assumptions.
The main point I'm trying to make is that it shouldn't be neccessary to alter the existing widgets. Instead one should be able to provide custom widgets with their own CSS and Javascript.
I've already begun to implement plugin support and restructure the existing widgets into plugins. I'm currently using ctools, but I guess it shouldn't be a problem to change that into a simple plugin hook.
Comment #5
chi commentedAt the moment I don't have enough time for this project. Feel free to commit any changes if you have strong vision of how it should work.
https://www.drupal.org/node/2312279#comment-9011313
Comment #6
ciss commentedJust a heads up: I've rewritten large parts of mvw based on 7.x-1.x and will be pushing the changes to 7.x-3.x at the start of next week if there are no objections.
The most important changes are:
Comment #7
ciss commentedPushed to 7.x-1.x-plugins.