Parcourir la source

过滤相同的标签

visuddhinanda il y a 10 mois
Parent
commit
31bf20314e
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4 2
      api-v8/resources/views/blog/category.blade.php

+ 4 - 2
api-v8/resources/views/blog/category.blade.php

@@ -20,8 +20,10 @@
             <section class="widget tagCloud">
                 <div class="tagCloud-tags">
                     @foreach($tagOptions as $id => $tag)
-                    <a href="{{ rtrim(url()->current(), '/') . '/' . $tag['tag']->name }}">{{ $tag['tag']->name }}</a>
-                    @endforeach
+                    @if($tag['count'] < $count)
+                        <a href="{{ rtrim(url()->current(), '/') . '/' . $tag['tag']->name }}">{{ $tag['tag']->name }}({{ $tag['count'] }})</a>
+                        @endif
+                        @endforeach
                 </div>
             </section>
         </div>