Skip to content
Snippets Groups Projects
Verified Commit ce920f86 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Fix bootstrap 5 pagebrowser to not show next and prev links if no...

[BUGFIX] Fix bootstrap 5 pagebrowser to not show next and prev links if no next or prev items are available
parent 3942fbac
No related branches found
No related tags found
No related merge requests found
......@@ -7,22 +7,29 @@
<nav aria-label="Jobs pagination">
<ul class="pagination mb-0">
<li class="page-item {f:if(condition: '!{prevPageExist}', then: 'disabled')}">
<f:variable name="prevPage" value="{currentPage - 1}" />
<f:if condition="{prevPage} == 0">
<f:if condition="{prevPageExist}">
<f:then>
<f:link.action addQueryString="untrusted" class="page-link"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}"
additionalAttributes="{aria-label: 'Previous'}">
&laquo;
</f:link.action>
<f:variable name="prevPage" value="{currentPage - 1}" />
<f:if condition="{prevPage} <= 0">
<f:then>
<f:link.action addQueryString="untrusted" class="page-link"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}"
additionalAttributes="{aria-label: 'Previous'}">
&laquo;
</f:link.action>
</f:then>
<f:else>
<f:link.action addQueryString="untrusted" class="page-link"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}"
additionalParams="{tx_sgjobs_pagebrowser: {currentPage: prevPage}}"
additionalAttributes="{aria-label: 'Previous'}">
&laquo;
</f:link.action>
</f:else>
</f:if>
</f:then>
<f:else>
<f:link.action addQueryString="untrusted" class="page-link"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}"
additionalParams="{tx_sgjobs_pagebrowser: {currentPage: prevPage}}"
additionalAttributes="{aria-label: 'Previous'}">
&laquo;
</f:link.action>
<span class="page-link">&laquo;</span>
</f:else>
</f:if>
</li>
......@@ -30,7 +37,7 @@
<f:if condition="{enableLessPages} && {showLessPages}">
<li class="page-item">
<f:variable name="lessPage" value="{currentPage - 2}" />
<f:if condition="{lessPage} == 0">
<f:if condition="{lessPage} <= 0">
<f:then>
<f:link.action addQueryString="untrusted" class="page-link"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}">
......@@ -59,7 +66,7 @@
</f:then>
<f:else>
<li class="tx-pagebrowse-page">
<f:if condition="{pageLink.page} == 0">
<f:if condition="{pageLink.page} <= 0">
<f:then>
<f:link.action addQueryString="untrusted" class="page-link"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}">
......@@ -91,15 +98,22 @@
</f:if>
<li class="page-item {f:if(condition: '!{nextPageExist}', then: 'disabled')}">
<f:variable name="nextPage" value="{currentPage + 1}" />
<f:link.action addQueryString="untrusted" class="page-link"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}"
additionalParams="{tx_sgjobs_pagebrowser: {currentPage: nextPage}}"
additionalAttributes="{aria-label: 'Next'}">
&raquo;
</f:link.action>
<f:if condition="{nextPageExist}">
<f:then>
<f:variable name="nextPage" value="{currentPage + 1}" />
<f:link.action addQueryString="untrusted" class="page-link"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}"
additionalParams="{tx_sgjobs_pagebrowser: {currentPage: nextPage}}"
additionalAttributes="{aria-label: 'Next'}">
&raquo;
</f:link.action>
</f:then>
<f:else>
<span class="page-link">&raquo;</span>
</f:else>
</f:if>
</li>
</ul>
</nav>
</f:if>
</f:section>
\ No newline at end of file
</f:section>
......@@ -10,7 +10,7 @@
<f:then>
<li class="tx-pagebrowse-prev">
<f:variable name="prevPage" value="{currentPage - 1}"/>
<f:if condition="{prevPage} == 0">
<f:if condition="{prevPage} <= 0">
<f:then>
<f:link.action addQueryString="untrusted"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}"
......@@ -34,7 +34,7 @@
<f:if condition="{enableLessPages} && {showLessPages}">
<li>
<f:variable name="lessPage" value="{currentPage - 2}"/>
<f:if condition="{lessPage} == 0">
<f:if condition="{lessPage} <= 0">
<f:then>
<f:link.action addQueryString="untrusted"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}">
......@@ -66,7 +66,7 @@
</f:then>
<f:else>
<li class="tx-pagebrowse-page">
<f:if condition="{pageLink.page} == 0">
<f:if condition="{pageLink.page} <= 0">
<f:then>
<f:link.action addQueryString="untrusted"
argumentsToBeExcludedFromQueryString="{0: 'tx_sgjobs_pagebrowser'}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment