This issue is spun off from #2831274-390: Bring Media entity module to core as Media module, specifically this point of review:

Twig templates use ? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article - I don't think that media items should wrapped in that.

phenaproxima: Open to suggestions here, but not sure what a more appropriate tag would be.

seanB: It’s either this, or a plain old div I believe. I think perfectly described that a media item is a ‘self-contained composition in a document’ and ‘independently distributable or reusable’.

alexpott: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article the aria roles that are related really do not make me think this is at all related to what is in media and when you put a media entity on a node using entity reference it's going to be wrapped in article tags - inside another article - seems weird.

This is postponed on #2831274: Bring Media entity module to core as Media module.

CommentFileSizeAuthor
#3 2878115-3.patch721 bytesmarcoscano
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

phenaproxima created an issue. See original summary.

phenaproxima’s picture

Status: Postponed » Active

#2831274: Bring Media entity module to core as Media module has landed, so this is no longer postponed.

marcoscano’s picture

Status: Active » Needs review
Issue tags: +D8Media
FileSize
721 bytes

Any problems with a plain old div?

phenaproxima’s picture

Issue tags: +frontend

I have no problem with a DIV, personally...although, given the nature of media, figure might be a more appropriate tag? Should we get front-end maintainer review?

Tess Bakker’s picture

I would be nice to use the same conditions and maybe options as in https://api.drupal.org/api/drupal/core%21modules%21node%21templates%21no... but in default it shows only the fields from the view mode.

As for the wrapper tag, I would choose DIV instead of ARTICLE, most of the time the entity will be included inside a node.

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -D8Media +Media Initiative

@Tessa Bakker: Adding more variables to the template is certainly debatable, but outside the scope of this issue :)

For a wrapper tag, I have seen no evidence that anyone objects to a plain DIV. I'm marking this RTBC.

starshaped’s picture

I think a DIV is fine here. +1 RTBC :)

  • Gábor Hojtsy committed 7bbb417 on 8.4.x
    Issue #2878115 by marcoscano, phenaproxima, Tessa Bakker, starshaped:...
Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

It is definitely not an article. Since it may be a video or an image or a document, we cannot say its a figure either. So a div seems most safe to use.

Status: Fixed » Closed (fixed)

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