Hope this help how to figure out your request
<?php
$werdegang = 'werdegang'; // werdegang parent group
$station1 = 'jahr_station_1'; // ' child group 1
$station2 = 'jahr_station_2'; // 'child group 2
$station3 = 'jahr_station_3'; // 'child group 3
$station1Jahr="jahr1";
$station2Jahr="jahr2";
$station3Jahr="jahr3";
$station1Title="jahr1_Title";
$station1Text="jahr1_Text";
$station2Title="jahr2_Title";
$station2Text="jahr2_Text";
$station3Title="jahr3_Title";
$station3Text="jahr3_Text";
?>
<?php if(
(!empty($station1Title) && !empty($station1Text))
&& (!empty($station2Title) && !empty($station2Text))
&& (!empty($station3Title) && !empty($station3Text))
&& (!empty($station1) && !empty($station2) && !empty($station3))
&& (!empty($station1Jahr) && !empty($station2Jahr) && !empty($station3Jahr))
) { ?>
<section class="werdegang">
<span class="werdegang-headline">Headline</span>
<?php echo $station1; ?>
<hr class="willkommen-divider"></hr>
<div class="werdegang-container">
<div class="timeline">
<div class="timeline-nav">
<div class="timeline-nav__item"><?php echo $station1Jahr;?></div>
<div class="timeline-nav__item"><?php echo $station2Jahr;?></div>
<div class="timeline-nav__item"><?php echo $station3Jahr;?></div>
</div>
<div class="timeline-wrapper">
<div class="timeline-slider">
<?php if( !empty($station1Title) && !empty($station1Text) ) { ?>
<div class="timeline-slide" data-year="<?php echo $station1Jahr;?>">
<div class="timeline-slide__content">
<h4 class="timeline-title"><?php echo $station1Title;?></h4>
<p class="timeline-text"><?php echo $station1Text;?></p>
</div>
</div>
<?php }?>
<?php if( !empty($station2Title) && !empty($station2Text) ) { ?>
<div class="timeline-slide" data-year="<?php echo $station2Jahr;?>">
<div class="timeline-slide__content">
<h4 class="timeline-title"><?php echo $station2Title;?></h4>
<p class="timeline-text"><?php echo $station2Text;?></p>
</div>
</div>
<?php }?>
<?php if( !empty($station3Title) && !empty($station3Text) ) { ?>
<div class="timeline-slide" data-year="<?php echo $station3Jahr;?>">
<div class="timeline-slide__content">
<h4 class="timeline-title"><?php echo $station3Title;?></h4>
<p class="timeline-text"><?php echo $station3Text;?></p>
</div>
</div>
<?php }?>
</div>
</div>
</div>
</div>
</section>
<?php } else {
echo 'some field are not filled';
}
?>