Ejemplo n.º 1
0
function lamtech_preprocess_node(&$vars)
{
    // kpr($vars);
    if (isset($vars['content']['field_category']) && count($vars['content']['field_category'])) {
        $vars['category'] = $vars['content']['field_category'][0];
        unset($vars['content']['field_category']);
    }
    $helper = NULL;
    switch ($vars['type']) {
        case 'cta':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/cta/CTA.php';
            $helper = new CTA();
            $helper->preprocess($vars);
            break;
        case 'features_intro':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/fi/FeaturesIntro.php';
            $helper = new FeaturesIntro();
            $helper->preprocess($vars);
            break;
        case 'gallery':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/gallery/Gallery.php';
            $helper = new Gallery();
            $helper->preprocess($vars);
            break;
        case 'testimonials':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/testimonials/Testimonials.php';
            $helper = new Testimonials();
            $helper->preprocess($vars);
            break;
        case 'hero':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/hero/Hero.php';
            $helper = new Hero();
            $helper->preprocess($vars);
            break;
        case 'team':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/team/Team.php';
            $helper = new Team();
            $helper->preprocess($vars);
            break;
        case 'statistic':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/statistic/Statistic.php';
            $helper = new Statistic();
            $helper->preprocess($vars);
            break;
        case 'contact_info':
            require_once DRUPAL_ROOT . '/' . drupal_get_path('theme', 'lamtech') . '/tpl/anb/contact-info/ContactInfo.php';
            $helper = new ContactInfo();
            $helper->preprocess($vars);
            break;
        case 'advanced_page':
            unset($vars['content']['field_hide_title']);
            break;
    }
    // kpr($vars);
}