<?php
/**
 * Main template for building the portfolio single page.
 *
 * This template can be overriden from theme layer by
 * creating templates/portfolio/portfolio-project.php
 * inside the theme folder.
 *
 * @variables
 *   These variables are available for use :
 *
 *   $meta                 = array of meta data
 *   $meta['hover']        = array of meta data from post hover configuration
 *   $meta['hovericons']   = array of meta data for the hover icons
 *   $meta['fotorama']     = array of meta data for the fotorama post configuration
 *   $meta['media']        = array of media contents
 *   $meta['project']      = array of project contents
 *
 *
 *   $portfolioConfig               = array of global configurations specially for the full page one.
 *   $show                 = array of configured what to show or hide
 *   $portfolioConfigObject         = the configuration object that can be used for retrieving
 *                           single configured settings via getOption($type, $key, $subkey) method
 *   $this                 = the template object, you can call its method.
 *   $this->getBootstrapGrid() = Template wrapper for building bootstrap css class easily.
 *
 * @see VTCore_Portfolio_Templates::showContent()
 * @see VTCore_Portfolio_Config::getOption();
 * @see VTCore_Bootstrap_Grid_Column();
 *
 * @author jason.xie@victheme.com
 */
?>
<div class="portfolio-project">
  <?php foreach ($meta['project']['contents'] as $delta => $project) : ?>

    <?php
    // Cleaning first and skip if empty
    $project = array_filter($project);
    if (empty($project)) {
      continue;
    }
    ?>


    <div class="portfolio-project-item">
      <?php
      // Build icon using VTCore Fontawesome class
      if (!empty($project['icon'])) {
        $icon = new VTCore_Fontawesome_faIcon($project);
        $icon->render();
      }
      ?>

      <?php if (!empty($project['title'])) : ?>
        <h3
          class="portfolio-project-title page-header"><?php echo wp_kses_post($project['title']); ?></h3>
      <?php endif; ?>

      <?php if (!empty($project['body'])) : ?>
        <div
          class="portfolio-project-body"><?php echo wp_kses_post($project['body']); ?></div>
      <?php endif; ?>
    </div>

  <?php endforeach; ?>
</div>
