Skip to content

portal-logo class missing on <img>-only header logo #1185

Open

Description

@wesleyboar

Problem

When a Picture uses the TACC template override logic that hoists instance.attributes_str to <a> or to <figure>, child templates cannot reliably add a separate class on <img> for the img-only case.

video.of.portal-logo.class.bug.issue.GH-1185.mov

State

Header logo1 needs portal-logo on <img>. Though Core-Styles supports logo having link and not having link (i.e. <img>-only markup), Core-CMS fails to add class="portal-logo" to <img> when logo has no link (or no caption).

Linked header logos (default: home page link) are unaffected.

Cause

taccsite_cms/templates/djangocms_picture/default/picture.html hoists plugin attributes to the parent when link, caption, default caption, or child plugins exist. Otherwise attributes render on <img>. A second class="portal-logo" via picture_attributes_img duplicates class on <img> when attributes are not hoisted; browsers keep one value, so portal-logo is lost.

Reproduction

  1. Header logo plugin with portal_logo picture template.
  2. Remove link (and caption).
  3. Expect <img class="… portal-logo"> (or equivalent).
  4. Observe missing (or incorrect) portal-logo on <img>.

Context

Footnotes

  1. portal_logo template + HeaderLogoPlugin ↩

Activity

  1. added a commit that references this issue on Jun 18, 2026
  2. wesleyboar commented on Jun 18, 2026

    @wesleyboar
    MemberAuthor

    Draft Fix

    Warning

    This fix has since been overwritten by simpler code that restores the bug.

  3. changed the title [-]Picture attribute hoisting: portal-logo missing on img-only header logo[/-] [+]`portal-logo` class missing on `<img>`-only header logo[/+] on Jun 18, 2026
  4. added a commit that references this issue on Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions