Bootstrap Carousel with links

Issue #272 new
Former user created an issue

Adding this:

    if(!is_array($item['link'])) $item['link'] = array('href'=>$item['link']);

    echo CHtml::openTag('a', $item['link']);

in line 152 of TbCarousel.php and this:

if(isset($item['link'])) echo CHtml::closeTag('a');

in line 184 would let you use Bootstrap Carousel with links -- i.e. make each image clickable.

Link can be given as just string (only URL, passed to href):

'link'=>Yii::app()->createAbsoluteUrl('main/show', array('id'=>$video->id))

or as an array, where you specify each <a> tag's attributes by yourself:

    'href'=>"Yii::app()->createAbsoluteUrl('main/show', array('id'=>$video->id))"

That's all folks! :] Sorry, but due to high time pressure, I'm unable to create commit myself and prepare pull request for you. You'll have to merge this with your code yourself, if you're willing to extend Bootstrap Carousel with link-like functionality.

Comments (0)

  1. Log in to comment