Views offers various places to allow people to replace certain piece of html with another element.

In views/config/views.settings.yml you can setup which tags are available by default, which are currently sort of the common tags of HTML 4.

If someone wants to do this task: Find out the most used HTML tags and add them.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nagwani’s picture

Status: Active » Needs review
FileSize
365 bytes

Added a few HTML tags

dawehner’s picture

Thanks for working on that!

We certainly also want stuff like section.

droplet’s picture

+++ b/core/modules/views/config/views.settings.ymlundefined
@@ -33,3 +33,8 @@ field_rewrite_elements:
+  a: A
+  br: BR
...
+  img: IMG

wrap with br/img / a ?

dawehner’s picture

Yeah droplet that's a good point.

We just want to have HTML tags which are used as wrappers, so none of those actually are.

nagwani’s picture

I assume we want HTML 5 wrapper tags as well. Will update with those

nagwani’s picture

Assigned: Unassigned » nagwani
Status: Needs review » Needs work
nagwani’s picture

Status: Needs work » Needs review
FileSize
351 bytes

Removed not wrapper tags. Added aside tag.

Based on some research on internet, I am not sure if we would want to allow the section tag.
http://html5doctor.com/downloads/h5d-sectioning-flowchart.png
http://html5doctor.com/avoiding-common-html5-mistakes/

samhassell’s picture

How would <ul> and <li> work in this case?

Applying <ul> gives:

<div class="views-field views-field-title">        
  <ul class="field-content">
    <a href="/node/8">Eu Neo</a>
  </ul>  
</div>

I can't see any way to rewrite this into something that makes sense. Even if you wrap the <a> in an <li>, an unordered list with one item doesn't make sense.

dawehner’s picture

I guess some of those could help: article, section, aside, details?, maybe more.

dawehner’s picture

Status: Needs review » Needs work
hussainweb’s picture

Status: Needs review » Needs work
FileSize
616 bytes

How about this list (attached)?

Some of the omissions, and the reason why I omitted them:

  • main - There should only be one main tag in a document, so I don't think it is a good candidate for views.
  • figcaption - This is generally within figure.
  • sup, sub - This is generally always used with other inline text.
  • Other inline tags like mark, dfn, time, abbr, etc... for the same reason.

What are your thoughts on the omissions?

On the other hand, what about the list attached? I realize it is rather an extensive list. Which ones do you think we should keep?

hussainweb’s picture

Status: Needs work » Needs review

Issue tags: -Novice, -VDC

The last submitted patch, views-html-tags-1888698-11.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
Issue tags: +Novice, +VDC

#11: views-html-tags-1888698-11.patch queued for re-testing.

dawehner’s picture

I like all this tags.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Let's get them in.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 8043b9a and pushed to 8.x. Thanks!

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