{{#linkedPagePopupHref}}
<div class="popup-in-page m-3" id="popup-in-page-{{dataNode.id}}"></div>
{{/linkedPagePopupHref}} {{^linkedPagePopupHref}} {{#hasAnyContent}}
<div class="card {{paragraphColClass}}">
  <div class="row no-gutters">
    {{#beforeGalleriePosition}}
    <div class="col-12">{{> cardImg}}</div>
    {{/beforeGalleriePosition}} {{#hasCardBody}} {{#dataNode.anchor}}
    <a name="anchor_{{&.}}"></a>
    {{/dataNode.anchor}}
    <div class="col">
      <div class="card-body py-1">
        {{#hasCardTitle}}
        <h2 class="card-title {{titleClass}}" id="h2_{{dataNode.anchor}}">
          {{dataNode.paragraphTitle}}{{#parentPageTitle}}<span
            class="ml-2 float-right badge badge-secondary badge-light badge-pill font-weight-light font-italic"
            >{{parentPageTitle}}</span
          >{{/parentPageTitle}}
        </h2>
        {{/hasCardTitle}}
        <div>
          {{#leftGalleriePosition}}
          <div class="pl-0 {{galleryColClass}}">{{> cardImg}}</div>
          {{/leftGalleriePosition}} {{#rightGalleriePosition}}
          <div class="pr-0 {{galleryColClass}}">{{> cardImg}}</div>
          {{/rightGalleriePosition}} {{#hasContentText}}
          <div class="card-text {{contentClass}}">{{dataNode.contentText}}</div>
          {{/hasContentText}}
        </div>
      </div>
    </div>
    {{/hasCardBody}} {{#afterGalleriePosition}}
    <div class="col-12">{{> cardImg}}</div>
    {{/afterGalleriePosition}}
  </div>
</div>
{{/hasAnyContent}} {{/linkedPagePopupHref}}
<script type="text/javascript">
  (async () => {
    {{#dataNode.anchor}}
    let h2 = document.querySelector('#h2_{{dataNode.anchor}}');
    if (h2) {
      if (document.querySelector('#h1_{{dataNode.anchor}}')) {
        if (
          h2.parentElement.parentElement.textContent.trim() ===
          h2.textContent.trim()
        ) {
          h2.parentElement.parentElement.remove();
        } else {
          h2.remove();
        }
      }
    }
    {{/dataNode.anchor}}
    {{#linkedPagePopupHref}}
    loadPopup('{{&.}}').then(content=>document.getElementById('popup-in-page-{{dataNode.id}}').innerHTML = content);
          {{/linkedPagePopupHref}}

  })();
</script>
