Browse Source

fix: CTA icon in Slider widget only works with fas icon pack (#1189)

Joel Scheuner 6 years ago
parent
commit
adfc2803be
1 changed files with 6 additions and 2 deletions
  1. 6 2
      layouts/partials/widgets/slider.html

+ 6 - 2
layouts/partials/widgets/slider.html

@@ -34,10 +34,14 @@
         {{ end }}
 
         {{ if $item.cta_url }}
-        {{ $pack := or .icon_pack "fa" }}
+        {{ $pack := or .cta_icon_pack "fas" }}
+        {{ $pack_prefix := $pack }}
+        {{ if in (slice "fab" "fas" "far" "fal") $pack }}
+          {{ $pack_prefix = "fa" }}
+        {{ end }}
         <p>
           <a href="{{ $item.cta_url }}" class="btn btn-light btn-lg">
-            {{- with $item.cta_icon -}}<i class="{{ $pack }} {{ $pack }}-{{ . }}" style="padding-right: 10px;"></i>{{- end -}}
+            {{- with $item.cta_icon -}}<i class="{{ $pack }} {{ $pack_prefix }}-{{ . }}" style="padding-right: 10px;"></i>{{- end -}}
             {{- $item.cta_label | emojify | safeHTML -}}
           </a>
         </p>