[BUGFIX] Avoid prev/next arrows if only 1 system news is shown 78/57278/2
authorGeorg Ringer <georg.ringer@gmail.com>
Wed, 20 Jun 2018 17:15:30 +0000 (19:15 +0200)
committerNicole Cordes <typo3@cordes.co>
Thu, 21 Jun 2018 09:14:43 +0000 (11:14 +0200)
If only one system news is shown, it makes no sense to render arrows
to switch to other news records. Therefore those should only be
shown if there are at least 2 records.

Resolves: #85322
Releases: master, 8.7
Change-Id: I636b90121729bb2f12c2313a3cb7e8b858367970
Reviewed-on: https://review.typo3.org/57278
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
typo3/sysext/backend/Resources/Private/Partials/LoginNews.html

index 7b677c9..d756510 100644 (file)
@@ -9,13 +9,15 @@
                                </div>
                        </f:for>
                </div>
-               <a class="left typo3-login-carousel-control" href="#loginNews" role="button" data-slide="prev">
+               <f:if condition="{loginNewsItems -> f:count()} > 1">
+                       <a class="left typo3-login-carousel-control" href="#loginNews" role="button" data-slide="prev">
                        <i class="fa fa-angle-left"></i>
                        <span class="sr-only"><f:translate key="login.news.previous" /></span>
-               </a>
-               <a class="right typo3-login-carousel-control" href="#loginNews" role="button" data-slide="next">
-                       <i class="fa fa-angle-right"></i>
-                       <span class="sr-only"><f:translate key="login.news.next" /></span>
-               </a>
+                       </a>
+                       <a class="right typo3-login-carousel-control" href="#loginNews" role="button" data-slide="next">
+                               <i class="fa fa-angle-right"></i>
+                               <span class="sr-only"><f:translate key="login.news.next" /></span>
+                       </a>
+               </f:if>
        </div>
 </f:if>