This module is great and I'm making in a dependency for the DRD module. What I just discovered are 2 missing wrapper classes when a view is attached to an entity:
- The class view-[view-name] should be added always
- If the advanced settings of a view have another class being defined, that should also be added
Currently, they're both missing and instead the wrapper has this markup:
<div class="contextual-region js-view-dom-id-f2825972edb4a2034a0d9e5edb0eb048e34202d2a42f0d947f92f86809e65227">
<div data-contextual-id="entity.view.edit_form:view=drd_domain:location=view&name=drd_domain&display_id=page_1&langcode=en" class="contextual">
...
</div>
</div>
Those attributes are hard to be used in JavaScript and CSS. Any chance of getting the default classes added to the wrapper?
Comments
Comment #2
ahebrank commentedThese classes would be added in the template (here: https://github.com/ahebrank/eva/blob/8.x-1.x/templates/eva-display-entit... )-- it looks like having the views-* classes for a regular view build depends on the theme, because classy has them and stable does not (compare views-view.html.twig for those themes).
I don't really see any downside to adding them in to the template (i.e, more closely match the classy template). Feel free to put up a patch if you get to it before I do.
#2 is a bigger problem and I want to make sure I can replicate that.
Comment #3
ahebrank commentedOK, this (copied over from core/modules/views) should take care of the second problem and provide template variables for the first.
Comment #4
ahebrank commentedOK, find full diff and patch here:
https://github.com/ahebrank/eva/compare/issue-2839717?w=1
https://github.com/ahebrank/eva/compare/issue-2839717.patch
(I find a thread full of patches hard to follow; these links will stay current through the life of this issue, when the branch will be merged into dev).
RTBme -- let me know if these work or if anyone has issues with adding these classes by default.
Comment #5
ahebrank commentedComment #6
jurgenhaas@ahebrank this is looking good and offers everything I was looking for. Thanks for the quick response.
Comment #7
ahebrank commentedSure thing. Merged to dev, PR patch attached.
Comment #8
semanthis commented@ahebrank thank You for all Your work...You are fantastic...
Comment #10
ahebrank commentedThis appears in the 8.x-1.1-rc1 release.
Comment #11
aaronbaumanI'm on D10 using radix theme, and my EVA is rendered inside a container that doesn't get assigned the view classes.
Not sure if this is a regression, or D10 related, or something specific to my theme setup.
Anyone else have this issue before i open a new thread?