Hi.I am a quite beginner here.. I have been doing some smaller umbracosites and now I wanted to implement bootstrap..My problem is how to get the bootstrap carousel working.I have tried to implement it in the code but it is not working as it should. It just shows the content above each other instead of in the carousel.Does any have a solution or an example to see??My code is like this..
If you see the correct content but just not in the carousel — that's usually because the JavaScript or the CSS doesn't kick in. Which means that you're either not generating the correct markup, or you've inadvertently missed a class and/or id somewhere.
Assuming your slide images render correct (so no missing images etc.), there's reallyonly one thing that I could imagine coming out wrong in the code you've pasted - because XSLT will output well-formed XML by default, your prev and next links may be rendered as self-closing links, e.g.: <a class="left carousel-control" href="#heroSlider" data-slide="prev" /> which can totally break layout in some browsers...
To fix that, you can add an <xsl:comment/> instruction inside of each of them to prevent the XSLT processor from closing them in the output.
Have you tried viewing the source (the real source - not the DOM Inspector's version) of the generated page? Does it look like it's supposed to?
Are the Bootstrap CSS & JS files being loaded?
If you inspect e.g. the #heroSlider element, is it getting any of its styles from the Bootstrap CSS file?
I just managed to get it to Work:) I still have to solve a problem with the class item as you can se in the code. The first has to be class="active item" if it has to work. I am unsure how to solve it. It Works with a litle hardcoded item, but that is no good..
Now I need to get all items from umbraco and somehow add the class active to the first item. How should I do that???
Bootstrap Carousel Problem
Hi.I am a quite beginner here.. I have been doing some smaller umbracosites and now I wanted to implement bootstrap..My problem is how to get the bootstrap carousel working.I have tried to implement it in the code but it is not working as it should. It just shows the content above each other instead of in the carousel.Does any have a solution or an example to see??My code is like this..
Hi Beginner,
If you see the correct content but just not in the carousel — that's usually because the JavaScript or the CSS doesn't kick in. Which means that you're either not generating the correct markup, or you've inadvertently missed a class and/or id somewhere.
Assuming your slide images render correct (so no missing images etc.), there's reallyonly one thing that I could imagine coming out wrong in the code you've pasted - because XSLT will output well-formed XML by default, your prev and next links may be rendered as self-closing links, e.g.:
<a class="left carousel-control" href="#heroSlider" data-slide="prev" />
which can totally break layout in some browsers...To fix that, you can add an
<xsl:comment/>
instruction inside of each of them to prevent the XSLT processor from closing them in the output.#heroSlider
element, is it getting any of its styles from the Bootstrap CSS file?Hope this helps you pinpoint the problem(s)...
/Chriztian
Hi Christian! Thanks for your support.
I just managed to get it to Work:) I still have to solve a problem with the class item as you can se in the code. The first has to be class="active item" if it has to work. I am unsure how to solve it. It Works with a litle hardcoded item, but that is no good.. Now I need to get all items from umbraco and somehow add the class active to the first item. How should I do that???
Hi,
Here's how to add a class to only the first item of a list:
As you can see, it's possible to override the attribute if a specific condition is met.
/Chriztian
Thanks a lot:) Problem is solved and you saved my evening:)
is working on a reply...