<?php
get_header();

if (have_posts()) :
  while (have_posts()) : the_post();
    // Add microdata wrapper based on template type
    $acfTemplateType = get_field('template_type');
    $itemType = ($acfTemplateType === 'simple' || $acfTemplateType === 'newLanding') ? 'https://schema.org/NewsArticle' : 'https://schema.org/WebPage';
    echo '<div itemscope itemtype="' . esc_attr($itemType) . '">';

    $acfTemplateType = get_field('template_type');
    switch ($acfTemplateType) {
      case 'simple':
        include "single-basic.php";
        break;
      case 'newLanding':
        include "single-basic.php";
        break;
      case 'oldLanding':
        include "single-rose.php";
        break;
      default:
        include "single-basic.php";
        break;
    }

    get_template_part('partials/fixed', 'les_vins_relationel');
    echo '</div>'; // Close microdata wrapper
    get_footer();
  endwhile;
endif;
