Separate Dataset buttons form metadata field#306
Conversation
b91acd4 to
4af02fa
Compare
|
Please check hooks in quanthub_download_button.module - do we need it? |
| '#attached' => [ | ||
| 'library' => [ | ||
| 'quanthub_download_button/download-button', | ||
| 'quanthub_metadata_button/metadata-button', |
There was a problem hiding this comment.
Using "quanthub_download_button" and "quanthub_metadata_button" libraries you make a dependency from the modules, when the core module should be independent from the additions.
What can be done:
Option 1 (the best):
Each of the modules "quanthub_download_button" and "quanthub_metadata_button" defines own field. You don't create a template for its, just outputs "#type" => "container", "#attributes" => ..., and you use node--dataset.html.twig in the theme to provide container and other structure.
Option 2 (quick):
You move the libraries definitions to the quanthub_core module and mark outdated modules as deprecated.
Option 3 (compromise):
You don't attach the libraries here, and create a minimal template in the module. And real template and libraries attachment goes to theme.
There was a problem hiding this comment.
So, I implemented option 3. Created the basic and a real template. Please check it.
… quanthub_download_button via template overriding
…variables are passed from quanthub_core_node_view()
You are right, we don’t need this anymore. Removed. |
No description provided.