Adjusted handling of empty breadcrumbs
authorMarcel Werk <burntime@woltlab.com>
Fri, 4 Dec 2020 11:27:04 +0000 (12:27 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 4 Dec 2020 11:27:04 +0000 (12:27 +0100)
com.woltlab.wcf/templates/ampFooter.tpl
com.woltlab.wcf/templates/pageMenuMobile.tpl

index b94e36991c37ce6f5a93e639773065249dc28a58..c76cd1d63663c27076bd48963d3abf7388bb33ed 100644 (file)
                        <ol class="breadcrumbs">
                                {assign var=__breadcrumbsDepth value=0}
                                {foreach from=$__wcf->getBreadcrumbs() item=$breadcrumb}
-                                       <li><a href="{$breadcrumb->getURL()}">{$breadcrumb->getLabel()}</a></li>
-                                       {assign var=__breadcrumbsDepth value=$__breadcrumbsDepth + 1}
+                                       {* skip breadcrumbs that do not expose a visible label *}
+                                       {if $breadcrumb->getLabel()}
+                                               <li><a href="{$breadcrumb->getURL()}">{$breadcrumb->getLabel()}</a></li>
+                                               {assign var=__breadcrumbsDepth value=$__breadcrumbsDepth + 1}
+                                       {/if}
                                {/foreach}
                        </ol>
                </amp-sidebar>
index c43dd23c072cb359866badf339115e1e10c0c751..7dc604ebb515e8324d668edbe2c114149093eaef 100644 (file)
                        {content}
                                {assign var=__breadcrumbsDepth value=0}
                                {foreach from=$__wcf->getBreadcrumbs() item=$breadcrumb}
-                                       <li class="menuOverlayItem">
-                                               <a href="{$breadcrumb->getURL()}" class="menuOverlayItemLink">
-                                                       <span{if $__breadcrumbsDepth} style="padding-left: {$__breadcrumbsDepth * 20}px" {/if} class="box24">
-                                                               <span class="icon icon24 fa-{if $__breadcrumbsDepth}caret-right{else}home{/if}"></span>
-                                                               <span class="menuOverlayItemTitle">{$breadcrumb->getLabel()}</span>
-                                                       </span>
-                                               </a>
-                                       </li>
-                                       {assign var=__breadcrumbsDepth value=$__breadcrumbsDepth + 1}
+                                       {* skip breadcrumbs that do not expose a visible label *}
+                                       {if $breadcrumb->getLabel()}
+                                               <li class="menuOverlayItem">
+                                                       <a href="{$breadcrumb->getURL()}" class="menuOverlayItemLink">
+                                                               <span{if $__breadcrumbsDepth} style="padding-left: {$__breadcrumbsDepth * 20}px" {/if} class="box24">
+                                                                       <span class="icon icon24 fa-{if $__breadcrumbsDepth}caret-right{else}home{/if}"></span>
+                                                                       <span class="menuOverlayItemTitle">{$breadcrumb->getLabel()}</span>
+                                                               </span>
+                                                       </a>
+                                               </li>
+                                               {assign var=__breadcrumbsDepth value=$__breadcrumbsDepth + 1}
+                                       {/if}
                                {/foreach}
                        {/content}
                {/hascontent}