# Replacing social icons

**URL:** <https://community.podlove.org/t/replacing-social-icons/2321>\
**Category:** Podlove Templates\
**Created:** [August 24, 2020, 8:13pm UTC](https://community.podlove.org/t/replacing-social-icons/2321 "2020-08-24T20:13:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomtjes](https://community.podlove.org/user_avatar/community.podlove.org/tomtjes/32/1560_2.png) [@tomtjes](https://community.podlove.org/u/tomtjes)\
**Post date:** [August 24, 2020, 8:13pm UTC](https://community.podlove.org/t/replacing-social-icons/2321/1 "2020-08-24T20:13:07Z")

</div>

Hi,  
I’d like to replace the social icons. I might use custom svg icons at some point, but currently I’m preferring FontAwesome, using its Wordpress plugin.

This template code theoretically works:

```auto
<ul>
    {% for service in contributor.services %}
        <li>
            <a target="_blank" title="{{ service.title }}" href="{{ service.profileUrl }}">
                <span class="fa-icon {{ service.name }}"></span>
            </a>
		</li>
	{% endfor %}
</ul>

<style>
.fa-icon::before {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
  }

.instagram::before {
    font-family: "Font Awesome 5 Brands"; font-weight: 400; content: "\f16d";
  }

.website::before {
    font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f0ac";
  }

.twitter::before {
    font-family: "Font Awesome 5 Brands"; content: "\f099";
  }
</style>

```

Except, `service.name` is not available. Could you add it to the list of template tags?  
I thought I might need to use just `service` but that doesn’t work either.

---

<div class="post-metadata">

**Author:** ![tomtjes](https://community.podlove.org/user_avatar/community.podlove.org/tomtjes/32/1560_2.png) [@tomtjes](https://community.podlove.org/u/tomtjes)\
**Post date:** [August 26, 2020, 5:33pm UTC](https://community.podlove.org/t/replacing-social-icons/2321/2 "2020-08-26T17:33:29Z")

</div>

I realized that using `service.name` wouldn’t solve the problem as some service names contain spaces and dots and parentheses as well:

> <https://github.com/podlove/podlove-publisher/blob/beta/lib/modules/social/data/services.yml>

I found a solution with Twig however, replacing spaces and dots with hyphens and deleting parentheses:

```auto
<ul>
    {% for service in contributor.services %}
        <li>
            <a target="_blank" title="{{ service.title }}" href="{{ service.profileUrl }}">
                <span class="fa-icon {{ service.title|lower|replace({' ': "-", '.': "-", '(': "", ')':""}) }}"></span>
            </a>
		</li>
	{% endfor %}
</ul>

```

---

<div class="post-metadata">

**Author:** ![ericteubert](https://community.podlove.org/user_avatar/community.podlove.org/ericteubert/32/1568_2.png) [@ericteubert](https://community.podlove.org/u/ericteubert)\
**Post date:** [August 29, 2020, 12:52pm UTC](https://community.podlove.org/t/replacing-social-icons/2321/3 "2020-08-29T12:52:02Z")

</div>

I added it to the current beta release as `service.type` ([https://github.com/podlove/podlove-publisher/commit/a9e517648825de1c9df2a43297d430d5f93c2898](https://github.com/podlove/podlove-publisher/commit/a9e517648825de1c9df2a43297d430d5f93c2898)).

---

<div class="post-metadata">

**Author:** ![tomtjes](https://community.podlove.org/user_avatar/community.podlove.org/tomtjes/32/1560_2.png) [@tomtjes](https://community.podlove.org/u/tomtjes)\
**Post date:** [September 8, 2020, 9:05pm UTC](https://community.podlove.org/t/replacing-social-icons/2321/4 "2020-09-08T21:05:50Z")

</div>

Just installed 3.0 (congrats!) and this works perfectly.

One more suggestion regarding available social icons: a podcast option would be useful!  
 ![Screen Shot 2020-09-08 at 17.05.03](https://community.podlove.org/uploads/podlove/original/2X/d/d8822db06cd41d37d30954535b77e49aadf595fe.png)

---

<div class="post-metadata">

**Author:** ![ericteubert](https://community.podlove.org/user_avatar/community.podlove.org/ericteubert/32/1568_2.png) [@ericteubert](https://community.podlove.org/u/ericteubert)\
**Post date:** [September 9, 2020, 8:12am UTC](https://community.podlove.org/t/replacing-social-icons/2321/5 "2020-09-09T08:12:17Z")

</div>

There’s always “website” as a fallback option – hopefully the podcast you want to link to has a website 😉

---

<div class="post-metadata">

**Author:** ![tomtjes](https://community.podlove.org/user_avatar/community.podlove.org/tomtjes/32/1560_2.png) [@tomtjes](https://community.podlove.org/u/tomtjes)\
**Post date:** [September 17, 2020, 1:21am UTC](https://community.podlove.org/t/replacing-social-icons/2321/6 "2020-09-17T01:21:45Z")

</div>

Solved by using the “website” option and adding “Podcast” as a title, plus

twig:

```auto
<a target="_blank" title="{{ service.title }}" href="{{ service.profileUrl }}">
                        <span class="fa-icon {# using font awesome icons defined in styles template #}
                        {%- if service.type == "website" and service.title != "Website" -%}
                            {{ service.title|lower }}
                        {%- else -%}
                            {{ service.type }}
                        {%- endif -%}
                        "></span>
                    </a>

```

css:

```auto
.fa-icon.podcast::before {
    font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f2ce";
  }

```
