/** * Implements hook_preprocess_html(). * Meta tags https://drupal.org/node/1468582#comment-5698732 */ function treetopstravel_preprocess_html(&$variables) { $meta_charset = array('#tag' => 'meta', '#attributes' => array('charset' => 'utf-8')); drupal_add_html_head($meta_charset, 'meta_charset'); $meta_x_ua_compatible = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'x-ua-compatible', 'content' => 'ie=edge, chrome=1')); drupal_add_html_head($meta_x_ua_compatible, 'meta_x_ua_compatible'); $meta_mobile_optimized = array('#tag' => 'meta', '#attributes' => array('name' => 'MobileOptimized', 'content' => 'width')); drupal_add_html_head($meta_mobile_optimized, 'meta_mobile_optimized'); $meta_handheld_friendly = array('#tag' => 'meta', '#attributes' => array('name' => 'HandheldFriendly', 'content' => 'true')); drupal_add_html_head($meta_handheld_friendly, 'meta_handheld_friendly'); $meta_viewport = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1')); drupal_add_html_head($meta_viewport, 'meta_viewport'); $meta_cleartype = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'cleartype', 'content' => 'on')); drupal_add_html_head($meta_cleartype, 'meta_cleartype'); // Use html5shiv. if (theme_get_setting('html5shim')) { $element = array('element' => array('#tag' => 'script', '#value' => '', '#attributes' => array('type' => 'text/javascript', 'src' => file_create_url(drupal_get_path('theme', 'treetopstravel') . '/js/html5shiv-printshiv.js')))); $html5shim = array('#type' => 'markup', '#markup' => "<!--[if lt IE 9]>\n" . theme('html_tag', $element) . "<![endif]-->\n"); drupal_add_html_head($html5shim, 'treetopstravel_html5shim'); } // Use Respond.js. if (theme_get_setting('respond_js')) { drupal_add_js(drupal_get_path('theme', 'treetopstravel') . '/js/respond.min.js', array('group' => JS_LIBRARY, 'weight' => -100)); } // Use normalize.css if (theme_get_setting('normalize_css')) { drupal_add_css(drupal_get_path('theme', 'treetopstravel') . '/css/normalize.css', array('group' => CSS_SYSTEM, 'weight' => -100)); } if (arg(0) == 'taxonomy' && arg(1) == 'term') { $term = taxonomy_term_load(arg(2)); $variables['classes_array'][] = 'vocabulary-' . strtolower($term->vocabulary_machine_name); } flexslider_add(); }
$imagen .= "<li><a href=\"" . $link . "\" ><img src='" . $url . "' /></a><div class='flex-caption'><div class='flex-caption-inner'>" . $titulo_slide_markup . $desc_slide_markup . $texto_boton_link_slide_markup . "</div></div></li>"; } else { $imagen .= "<li><a href=\"" . $link . "\" ><img src='" . $url . "' /></a></li>"; } } else { if ($titulo_slide != '' || $desc_slide != '') { if ($titulo_slide != '') { $titulo_slide_markup = "<h3>" . $titulo_slide . "</h3>"; } if ($desc_slide != '') { $desc_slide_markup = "<p>" . $desc_slide . "</p>"; } $imagen .= "<li><img src='" . $url . "' /><div class='flex-caption'><div class='flex-caption-inner'>" . $titulo_slide_markup . $desc_slide_markup . "</div></div></li>"; } else { $imagen .= "<li><img src='" . $url . "' /></li>"; } } } } ?> <div class="flexslider flexslider-interno"> <ul class="slides"> <?php print $imagen; ?> </ul> <div class="container-nav"></div> </div> <?php flexslider_add(); }
* you may add to a render array. * * Here are some sample uses of flexslider_add(). */ /** * Attach flexslider to an element using the specified option set. * * This call will look for an HTML element with id attribute of "my_image_list" * and return the JS settings to initialize FlexSlider on it using the option * set named "default". */ $attached = flexslider_add('my_image_list', 'default'); /** * Attach flexslider to an element using the library defaults. * * You also have the option of skipping the option set parameter if you want * to run with the library defaults. */ $attached = flexslider_add('my_image_list'); /** * Attach the flexslider library. * * Finally, you can simply attach the library. * This method would assume you would take care of * initializing a FlexSlider instance in your theme or custom javascript * file. * * Ex: $('#slider').flexslider(); */ $attached = flexslider_add();
<?php /** * @file views-view-unformatted.tpl.php * Default simple view template to display a list of rows. * * @ingroup views_templates */ flexslider_add('flexslider'); drupal_add_js("jQuery(document).ready(function () { jQuery('.flexslider').flexslider(); });", 'inline'); ?> <div class="flexslider"> <ul class="slides"> <?php foreach ($rows as $id => $row) { ?> <li> <?php print $row; ?> </li> <?php } ?> </ul> </div>