Last active
August 29, 2015 14:23
-
-
Save anishsheela/c2af2ce03610390fbd3e to your computer and use it in GitHub Desktop.
Drupal Owl Carousel using theme function or render array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function owl_menu_callback() { | |
$owlcarousel = array( | |
'#theme' => 'owlcarousel', | |
'#items' => array( | |
array('row' => '<img src="http://lorempixel.com/350/200" />'), // You can add any images/HTML here | |
array('row' => '<img src="http://lorempixel.com/351/201" />'), | |
array('row' => '<img src="http://lorempixel.com/352/202" />'), | |
array('row' => '<img src="http://lorempixel.com/353/203" />'), | |
array('row' => '<img src="http://lorempixel.com/354/204" />'), | |
array('row' => '<img src="http://lorempixel.com/355/205" />'), | |
), | |
'#settings' => array( | |
'grouping' => array(), | |
'uses_fields' => FALSE, | |
'id' => 'owlcarousel-gt', // Any ID you want to add | |
'instance' => 'owlcarousel_settings_default', // Settings name that you created in settings | |
'attributes' => array( | |
'class' => array( | |
0 => 'owlcarousel-class' // Any class you want to add | |
), | |
), | |
), | |
); | |
return $owlcarousel; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment