<head th:remove="tag" th:fragment="head(isSidebar, isBottomSidebarContent)">
  <th:block
    th:if="${isSidebar and isBottomSidebarContent}"
    th:insert="~{components/style-footer-sidebar/template :: head}"
  ></th:block>
</head>
<body
  th:remove="tag"
  th:fragment="body(wrapped, isSidebar, isBottomSidebarContent)"
  th:with="sidebarPos = ${theme.config?.styles?.footer_content_sidebar_position},
           sidebarNarrow = ${theme.config?.styles?.footer_content_sidebar_narrow ?: 'hide'},
           sidebarOpacity = ${theme.config?.styles?.footer_content_sidebar_opacity ?: '1'},
           isLeftSidebar = ${sidebarPos == 'bottom-left' or sidebarPos == 'top-left'},
           isRightSidebar = ${sidebarPos == 'bottom-right' or sidebarPos == 'top-right'}"
>
  <div th:if="${isSidebar and isBottomSidebarContent}" class="main-with-sidebar">
    <th:block
      th:if="${isLeftSidebar}"
      th:insert="~{components/footer-bottom-content/template :: body(
                   className = 'footer-bottom',
                   classAppend = 'footer-sidebar footer-sidebar--' + ${sidebarPos} + ' footer-sidebar--narrow-' + ${sidebarNarrow},
                   styleText = '--footer-sidebar-opacity:' + ${sidebarOpacity}
                  )}"
    ></th:block>
    <th:block th:replace="${wrapped}"></th:block>
    <th:block
      th:if="${isRightSidebar}"
      th:insert="~{components/footer-bottom-content/template :: body(
                   className = 'footer-bottom',
                   classAppend = 'footer-sidebar footer-sidebar--' + ${sidebarPos} + ' footer-sidebar--narrow-' + ${sidebarNarrow},
                   styleText = '--footer-sidebar-opacity:' + ${sidebarOpacity}
                  )}"
    ></th:block>
  </div>
  <th:block th:unless="${isSidebar and isBottomSidebarContent}">
    <th:block th:replace="${wrapped}"></th:block>
  </th:block>
</body>
