<?php /* Template Name: Page — Cabinet */ ?>

<?php

    while ( have_posts() ) : the_post();
        $pageData['title'] = get_the_title();
        
        $pageData['intro_cover'] = getImageUrl(get_field('intro_cover'));
        $pageData['intro_cover_object'] = get_field('intro_cover');
        $pageData['intro_title'] = get_field('intro_title');
        $pageData['intro_quote'] = get_field('intro_quote');

        $pageData['numbers_title'] = get_field('numbers_title');
        $pageData['numbers_quote'] = get_field('numbers_quote');
        $pageData['numbers_link'] = get_field('numbers_link');
        $pageData['numbers_list'] = get_field('numbers_list');

        $pageData['team_members'] = get_field('team_members');
        $pageData['team_intro'] = get_field('team_intro');
        $pageData['team_list'] = get_field('team_list');

        $pageData['posts_intro'] = get_field('posts_intro');
        $pageData['posts_link'] = get_field('posts_link');
        $pageData['posts_nbMax'] = get_field('posts_nbMax');
        $publiQuery = new WP_Query(array(
            'post_type' => 'publication',
            'posts_per_page' => $pageData['posts_nbMax'] ? $pageData['posts_nbMax'] : 10,
            // 'orderby' => 'num',
            // 'meta_key' => 'num',
            'order' => 'desc',
            'post_status' => 'publish'
        ));
        $pageData['posts_list'] = $publiQuery->posts;

        $pageData['honors_title'] = get_field('honors_title');
        $pageData['honors_link'] = get_field('honors_link');
        $pageData['honors_list'] = get_field('honors_list');

        $pageData['partner_title'] = get_field('partner_title');
        $pageData['partner_content'] = get_field('partner_content');
        $pageData['partner_link'] = get_field('partner_link');
        $pageData['partner_cover'] = getImageUrl(get_field('partner_cover'));
        $pageData['partner_cover_object'] = get_field('partner_cover');
    endwhile;

    get_header();
    include('layouts/cabinet.php');
    get_footer();

?>