result-card
Information
- Folder
src/components/patterns/job-market-search/result-card
Files
Schema
Mocks
Template
// src/components/patterns/job-market-search/result-card/result-card.twig
{% set result_card %}
<article class="ResultCard {% if is_all_jobs_card %}ResultCard--allJobs js-ResultCard--allJobs{% endif %}" data-theme="{{ theme }}">
<div class="ResultCard-wrapper">
{% if not is_all_jobs_card and (logo or as_template_element) %}
<div class="ResultCard-logo">
<img class="Image ResultCard-logoImage js-ResultCard-logoImage" src="{{ logo.uri }}" alt="{{ logo.alt }}" width="{{ logo.width|default('80') }}" height="{{ logo.height|default('80') }}">
</div>
{% endif %}
{% if show_badge or as_template_element %}
<div class="ResultCard-badge js-ResultCard-badge" {% if as_template_element %}hidden{% endif %}>
{% include "@elements/badge/badge.twig" with {
label: "Stelle der woche",
type: "week"
} only %}
</div>
{% endif %}
<div class="ResultCard-content">
<h4 class="ResultCard-title js-ResultCard-title">{{ title }}</h4>
<p class="ResultCard-description js-ResultCard-description">{{ description }}</p>
</div>
</div>
{% if is_all_jobs_card %}
{% include "@elements/button/button.twig" with {
label: link_label,
icon: "arrow-right",
icon_position: "right",
modifiers: ["tertiary", "isDark"],
size: "small",
url: url,
target: target|default(null)
} only %}
{% endif %}
{% if not is_all_jobs_card %}
<footer class="ResultCard-footer js-ResultCard-footer">
{% if location or as_template_element %}
<p class="ResultCard-location js-ResultCard-location">
{% include "@elements/icon/icon.twig" with {
name: "pin",
} only %}
<span class="ResultCard-locationText js-ResultCard-locationText">{{ location }}</span>
</p>
{% endif %}
{% if url or as_template_element %}
{# Using empty string for url to ensure component returns anchor, not button #}
{% include "@elements/button/button.twig" with {
classes: ["ResultCard-link js-ResultCard-link"],
label: link_label,
icon: "external-link",
icon_only: true,
modifiers: ["quaternary"],
url: "/",
target: "_blank"
} only %}
{% endif %}
</footer>
{% endif %}
</article>
{% endset %}
{% if as_template_element %}
<template id="{{ template_id }}">
{{ result_card }}
</template>
{% else %}
{{ result_card }}
{% endif %}
Error: schema is invalid: data/properties must be object