Contact Channel
Information
- Folder
src/components/patterns/contact-persons/contact-channel
Files
Schema
$schema: http://json-schema.org/draft-07/schema#
$id: /patterns/contact-persons/contact-channel
additionalProperties: false
properties:
title:
type: string
icon:
type: string
link:
type: object
properties:
title:
type: string
url:
type: string
format: uri-reference
Mocks
$hidden: true
$variants:
- $name: Mail
title: E-Mail
icon: mail
link:
title: erika.musterfrau@greenpeace.de
url: erika.musterfrau@greenpeace.de
- $name: Phone
title: Telefon
icon: phone
link:
title: '04012456'
url: '04012456'
Template
{% if icon == "mail" %}
{% set type = "mailto:" %}
{% elseif icon == "phone" %}
{% set type = "tel:" %}
{% endif %}
{% set href = type ? type ~ link.url : link.url %}
<li class="ContactChannel">
<p class="ContactChannel-title u-typo-copy-bold">
{% include "@elements/icon/icon.html.twig" with {
name: icon,
class: "ContactChannel-icon"
} only %}
{{ title }}
</p>
<a class="ContactChannel-link u-typo-copy-bold u-brandLink" href="{{ href|replace({' ': ''}) }}">
{{ link.title }}
</a>
</li>
Variants