FEATURE Introducing component
This commit is contained in:
parent
e8b7520ef5
commit
e8929c9c07
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
$post_id = get_the_ID();
|
||||
$activity_informations = get_field('activity_informations', $post_id);
|
||||
$buttons_links = get_field('buttons_links', $post_id);
|
||||
|
||||
?>
|
||||
<aside class="sidebar-single-activites">
|
||||
|
||||
<div class="sidebar-single-activites__title-container">
|
||||
<h2 class="sidebar-single-activites__title">
|
||||
<?php _e('Informations', 'carhop'); ?>
|
||||
</h2>
|
||||
|
||||
</div>
|
||||
|
||||
<ul class="sidebar-single-activites__informations">
|
||||
<?php foreach ($activity_informations as $activity_information) : ?>
|
||||
<?php
|
||||
$custom_title = isset($activity_information['title']) ? $activity_information['title'] : null;
|
||||
$title = $custom_title ?? get_activity_title_from_acf_layout_label($activity_information['acf_fc_layout'], $post_id) ?? null;
|
||||
?>
|
||||
<li>
|
||||
<?php if ($title) : ?>
|
||||
<h4 class="sidebar-single-activites__label">
|
||||
<?php echo $title; ?>
|
||||
</h4>
|
||||
<?php endif; ?>
|
||||
<p class="sidebar-single-activites__description">
|
||||
<?php echo $activity_information['description']; ?>
|
||||
</p>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<?php if (!empty($buttons_links)) : ?>
|
||||
|
||||
<ul class="sidebar-single-activites__buttons">
|
||||
<?php foreach ($buttons_links as $button_link) : ?>
|
||||
<li>
|
||||
<?php if ($button_link['acf_fc_layout'] === 'demander_formation') : ?>
|
||||
<a href="mailto:<?php echo $button_link['email'] ?>" class="cta cta--classic cta--rounded cta--has-icon button cta--demander-formation">
|
||||
Demander une formation
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($button_link['acf_fc_layout'] === 'programme' && $button_link['programme_type'] === 'url') : ?>
|
||||
<a href="<?php echo $button_link['link'] ?>" target="_blank" class="cta cta--classic cta--rounded cta--has-icon button cta--programme">
|
||||
Programme
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($button_link['acf_fc_layout'] === 'programme' && $button_link['programme_type'] === 'pdf') : ?>
|
||||
<a href="<?php echo $button_link['file']['url'] ?>" target="_blank" class="cta cta--classic cta--rounded cta--has-icon button cta--programme">
|
||||
Programme
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
<?php if ($button_link['acf_fc_layout'] === 'subscribe') : ?>
|
||||
<a href="<?php echo $button_link['link'] ?>" target="_blank" class="cta cta--classic cta--rounded cta--has-icon button cta--subscribe">
|
||||
S’inscrire
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</aside>
|
||||
Loading…
Reference in New Issue
Block a user