Don't output h3 tag if label is empty

Created on 1 November 2015, about 9 years ago
Updated 15 March 2023, over 1 year ago

the label and the h3 tag should actually only be outputted if there is actually a label. In case there is no label the empty h3 tag shouldn't appear.

Original issue summary
I am currently using fences together with Panels/Panelizer and had to upgrade to 7.x-2.x due to the removal of panels support in 7.x-1.x branch (se #16 of issue #1529242: Support for fences to render a field in a panel pane ).

Panels allows you to hide the field label (or at least overwrite title with empty value), but although label is empty the h3 tag will be shown always. IMHO the label and the h3 tag should actually only be outputted if there is actually a label. In case there is no label the empty h3 tag shouldn't appear.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code (fences)

Created by

🇩🇪Germany osopolar 🇩🇪 GER 🌐

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • 🇮🇳India kunal_sahu Karnataka

    Hi ,

    I reviewed this patch . This patch LGTM.

    kunal@LAPTOP-G4FTKS5H MINGW64 /c/xampp/htdocs/contributions/web/modules/contrib/fences-2605808 (2605808-dont-output-h3)
    $ git apply -v fences-dont-output-h3-for-empty-labels-2605808-9.patch
    Checking patch templates/field--fences-address.tpl.php...
    Checking patch templates/field--fences-article.tpl.php...
    Checking patch templates/field--fences-aside.tpl.php...
    Checking patch templates/field--fences-b.tpl.php...
    Checking patch templates/field--fences-bdi.tpl.php...
    Checking patch templates/field--fences-blockquote.tpl.php...
    Checking patch templates/field--fences-cite.tpl.php...
    Checking patch templates/field--fences-code.tpl.php...
    Checking patch templates/field--fences-dd.tpl.php...
    Checking patch templates/field--fences-del.tpl.php...
    Checking patch templates/field--fences-details.tpl.php...
    Checking patch templates/field--fences-div-div-div.tpl.php...
    Checking patch templates/field--fences-div.tpl.php...
    Checking patch templates/field--fences-dl.tpl.php...
    Checking patch templates/field--fences-dt.tpl.php...
    Checking patch templates/field--fences-em.tpl.php...
    Checking patch templates/field--fences-figcaption.tpl.php...
    Checking patch templates/field--fences-figure.tpl.php...
    Checking patch templates/field--fences-footer.tpl.php...
    Checking patch templates/field--fences-h1.tpl.php...
    Checking patch templates/field--fences-h2.tpl.php...
    Checking patch templates/field--fences-h3.tpl.php...
    Checking patch templates/field--fences-h4.tpl.php...
    Checking patch templates/field--fences-h5.tpl.php...
    Checking patch templates/field--fences-h6.tpl.php...
    Checking patch templates/field--fences-header.tpl.php...
    Checking patch templates/field--fences-hgroup.tpl.php...
    Checking patch templates/field--fences-i.tpl.php...
    Checking patch templates/field--fences-ins.tpl.php...
    Checking patch templates/field--fences-kbd.tpl.php...
    Checking patch templates/field--fences-mark.tpl.php...
    Checking patch templates/field--fences-menu.tpl.php...
    Checking patch templates/field--fences-nav.tpl.php...
    Checking patch templates/field--fences-no-wrapper.tpl.php...
    Checking patch templates/field--fences-ol.tpl.php...
    Checking patch templates/field--fences-p.tpl.php...
    Checking patch templates/field--fences-pre-code.tpl.php...
    Checking patch templates/field--fences-pre.tpl.php...
    Checking patch templates/field--fences-q.tpl.php...
    Checking patch templates/field--fences-rp-rt.tpl.php...
    Checking patch templates/field--fences-rt.tpl.php...
    Checking patch templates/field--fences-ruby.tpl.php...
    Checking patch templates/field--fences-s.tpl.php...
    Checking patch templates/field--fences-samp.tpl.php...
    Checking patch templates/field--fences-section.tpl.php...
    Checking patch templates/field--fences-small.tpl.php...
    Checking patch templates/field--fences-span.tpl.php...
    Checking patch templates/field--fences-strong.tpl.php...
    Checking patch templates/field--fences-sub.tpl.php...
    Checking patch templates/field--fences-summary.tpl.php...
    Checking patch templates/field--fences-sup.tpl.php...
    Checking patch templates/field--fences-u.tpl.php...
    Checking patch templates/field--fences-ul.tpl.php...
    Checking patch templates/field--fences-var.tpl.php...
    Applied patch templates/field--fences-address.tpl.php cleanly.
    Applied patch templates/field--fences-article.tpl.php cleanly.
    Applied patch templates/field--fences-aside.tpl.php cleanly.
    Applied patch templates/field--fences-b.tpl.php cleanly.
    Applied patch templates/field--fences-bdi.tpl.php cleanly.
    Applied patch templates/field--fences-blockquote.tpl.php cleanly.
    Applied patch templates/field--fences-cite.tpl.php cleanly.
    Applied patch templates/field--fences-code.tpl.php cleanly.
    Applied patch templates/field--fences-dd.tpl.php cleanly.
    Applied patch templates/field--fences-del.tpl.php cleanly.
    Applied patch templates/field--fences-details.tpl.php cleanly.
    Applied patch templates/field--fences-div-div-div.tpl.php cleanly.
    Applied patch templates/field--fences-div.tpl.php cleanly.
    Applied patch templates/field--fences-dl.tpl.php cleanly.
    Applied patch templates/field--fences-dt.tpl.php cleanly.
    Applied patch templates/field--fences-em.tpl.php cleanly.
    Applied patch templates/field--fences-figcaption.tpl.php cleanly.
    Applied patch templates/field--fences-figure.tpl.php cleanly.
    Applied patch templates/field--fences-footer.tpl.php cleanly.
    Applied patch templates/field--fences-h1.tpl.php cleanly.
    Applied patch templates/field--fences-h2.tpl.php cleanly.
    Applied patch templates/field--fences-h3.tpl.php cleanly.
    Applied patch templates/field--fences-h4.tpl.php cleanly.
    Applied patch templates/field--fences-h5.tpl.php cleanly.
    Applied patch templates/field--fences-h6.tpl.php cleanly.
    Applied patch templates/field--fences-header.tpl.php cleanly.
    Applied patch templates/field--fences-hgroup.tpl.php cleanly.
    Applied patch templates/field--fences-i.tpl.php cleanly.
    Applied patch templates/field--fences-ins.tpl.php cleanly.
    Applied patch templates/field--fences-kbd.tpl.php cleanly.
    Applied patch templates/field--fences-mark.tpl.php cleanly.
    Applied patch templates/field--fences-menu.tpl.php cleanly.
    Applied patch templates/field--fences-nav.tpl.php cleanly.
    Applied patch templates/field--fences-no-wrapper.tpl.php cleanly.
    Applied patch templates/field--fences-ol.tpl.php cleanly.
    Applied patch templates/field--fences-p.tpl.php cleanly.
    Applied patch templates/field--fences-pre-code.tpl.php cleanly.
    Applied patch templates/field--fences-pre.tpl.php cleanly.
    Applied patch templates/field--fences-q.tpl.php cleanly.
    Applied patch templates/field--fences-rp-rt.tpl.php cleanly.
    Applied patch templates/field--fences-rt.tpl.php cleanly.
    Applied patch templates/field--fences-ruby.tpl.php cleanly.
    Applied patch templates/field--fences-s.tpl.php cleanly.
    Applied patch templates/field--fences-samp.tpl.php cleanly.
    Applied patch templates/field--fences-section.tpl.php cleanly.
    Applied patch templates/field--fences-small.tpl.php cleanly.
    Applied patch templates/field--fences-span.tpl.php cleanly.
    Applied patch templates/field--fences-strong.tpl.php cleanly.
    Applied patch templates/field--fences-sub.tpl.php cleanly.
    Applied patch templates/field--fences-summary.tpl.php cleanly.
    Applied patch templates/field--fences-sup.tpl.php cleanly.
    Applied patch templates/field--fences-u.tpl.php cleanly.
    Applied patch templates/field--fences-ul.tpl.php cleanly.
    Applied patch templates/field--fences-var.tpl.php cleanly.
    

    RTBC ++ for #10 ,based on the above comments as well .

    Creating an MR for making it easy for the maintainer to merge.

    Please review and merge this MR . Thanks

  • @kunal_sahu opened merge request.
  • @kunal_sahu opened merge request.
  • 🇮🇳India kunal_sahu Karnataka

    Hi Sorry, targeted the wrong branch. Have fixed it . Please review and merge. thanks

  • Status changed to Fixed over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    Thank you for your work on this @osopolar and @dalin! Merged into 7.x-2.x-dev!

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

Production build 0.71.5 2024