Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Because custom markup and PHP fields often contain block-level XHTML, Views needs to know that the field should be treated as a block, not an inline, field in those cases. Otherwise, the field's contents will be output (by Views core) inside a 'span' element, which is invalid XHTML.
Refer to Views issue #298416: Span breaking XHTML strict.
Comment | File | Size | Author |
---|---|---|---|
#1 | views_customfield-set-element-type-1271296-1.patch | 636 bytes | biwashingtonial |
Comments
Comment #1
biwashingtonial CreditAttribution: biwashingtonial commentedThis patch is a quick fix. It outputs valid XHTML for non-inline fields, but it doesn't work for any use case requiring custom markup or PHP fields to display inline.
A better solution would implement element_type() in views_customfield_handler_field_markup and views_customfield_handler_field_phpcode to set the container element to 'div' or 'span' according to the specific contents of the field.