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:

  1. The class view-[view-name] should be added always
  2. 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

jurgenhaas created an issue. See original summary.

ahebrank’s picture

These 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.

ahebrank’s picture

OK, this (copied over from core/modules/views) should take care of the second problem and provide template variables for the first.

ahebrank’s picture

Assigned: Unassigned » ahebrank
Status: Active » Needs review

OK, 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.

ahebrank’s picture

jurgenhaas’s picture

Status: Needs review » Reviewed & tested by the community

@ahebrank this is looking good and offers everything I was looking for. Thanks for the quick response.

ahebrank’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new3.92 KB

Sure thing. Merged to dev, PR patch attached.

semanthis’s picture

@ahebrank thank You for all Your work...You are fantastic...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ahebrank’s picture

This appears in the 8.x-1.1-rc1 release.

aaronbauman’s picture

I'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?