This site uses cookies and similar technologies.

If you don't change browser settings, you agree to it.

I understand
2 years ago


I want to share with you, how i solved to display an images slideshow in my bootstrap template.

First i created a field x in my content type for the images which the slideshow should contain.

Then i published the field also in my Content Tab.

In the override file for the mainbody.php (templates/seb_one/positions/contenttypename/content/mainbody.php) i added following code:

<div id="carousel-example-generic" data-ride="carousel">

<!-- Indicators -->
<?php $slideindex = 0; ?>
<?php foreach($cck->get( 'fieldxname' )->value as $fx){ ?>
<?php $item_class_li = ($i == 1) ? 'active' : ''; ?>
<li data-target="#carousel-example-generic" data-slide-to="<?php echo $slideindex; ?>"></li>
<?php $slideindex++; ?>
<?php } ?>

<!-- Wrapper for slides -->
<div role="listbox">
<?php foreach($cck->get( 'fieldxname' )->value as $fx){ ?>
<?php $item_class = ($i == 1) ? 'item active' : 'item'; ?>
<img src="/<?php echo $fx->value; ?>" alt="<?php echo $fx->image_alt; ?>" title ="<?php echo $fx->image_title; ?>" />
<div> <?php echo $fx->image_title; ?> </div>
<?php $i++; ?>
<?php } ?>

<!-- Controls -->
<a href="#carousel-example-generic" role="button" data-slide="prev">
<span aria-hidden="true"></span> <span>Previous</span>
<a href="#carousel-example-generic" role="button" data-slide="next">
<span aria-hidden="true"></span> <span>Next</span>


Should work with all bootstrap themes. I hope that helps!



Get a VIP membership
2 years ago
Level 1

Hi Elisa,

Great stuff :) Thanks so much for sharing.

Please feel free to add this to the tutorials page. After it is reviewed it will be published. Keep it up!

3 Posts
2 years ago
Level 1

Hi... I try to do this on the Group X, but does not work for me. Anyone here knows how to do this on Seblod, but using Group X?

Now it's ok! I changed my code: for I follow this tutorial Thks!

45 Posts
2 months ago
Level 1


Do you have an idea why the images can not loaded? When I displayed the fieldX without the override the images are displayed and with the override the slideshow worked but just the images titles are displayed (without images).

Get a Book for SEBLOD