Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Unanswered

Image carousel not working

(0) ShareShare
ReportReport
Posted on by 2

Hello everyone,

 

I contact the community because I have an issue when I want to add a images carousel on my webite create with Power Pages. Sorry if it not the right place.

 

I followed this tutorial https://learn.microsoft.com/en-us/power-pages/configure/web-templates-as-components-carousel

 

And other tutorial and the result is the same: 

- All items are displayed

- No buttons are shown.

 

Someone can help me please ?

 

Code page HTML: 

<div class="container">{% include 'DemoYTCarousel' title:"DemoCarousel" interval:"6500" count:"2" height:"200" %}</div>
 
Code web template:
{% fetchxml locationsQuery %}
    <fetch mapping='logical'>
    <entity name='cre10_demoytcarousel'>
        <attribute name='cre10_name' />
        <attribute name='cre10_description' />
        <attribute name='cre10_carousel_url' />
    </entity>
</fetch>
{% endfetchxml %}

<h2>{{ title | default: "Locations" }}</h2>
{% assign interval = interval | integer %}
{% assign count = count | integer %}
{% assign height = height | integer %}
<span>Showing {{ count }} out of {{ locationsQuery.results.entities.size }}</span>

{% if locationsQuery.results.entities.size > 0 %}
    <div id="carousel-example-generic"
    class="carousel slide"
    data-ride="carousel"
    data-interval="{{interval}}">
    <!-- Indicators -->
    <ol class="carousel-indicators">
        {% for location in locationsQuery.results.entities limit: count %}
        <li
            data-target="#carousel-example-generic"
            data-slide-to="{{forloop.index0}}"
            class="{% if forloop.first %}active{% endif %}"></li>
        {% endfor %}
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">
        {% for loc in locationsQuery.results.entities limit: count %}
        <div class="item {% if forloop.first %}active{% endif %}" style="background-image:url('{{loc.cre10_carousel_url}}&Full=true'); height: {{height | default:500}}px">
            <div class="carousel-caption" style="background:white">
            <h3>{{ loc.cre10_name }}</h3>
            <p>{{ loc.cre10_description }}</p>
            </div>
        </div>
        {% endfor %}
    </div>

    <!-- Controls -->
    <a
        class="left carousel-control"
        href="#carousel-example-generic"
        role="button"
        data-slide="prev">
        <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
    </a>
    <a
        class="right carousel-control"
        href="#carousel-example-generic"
        role="button"
        data-slide="next">
        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
    </div>
{% endif %}

<style>
    .carousel .item {
    background-size: cover;
    background-repeat: no-repeat;
    }
</style>

{% manifest %}
    {
    "type": "Functional",
        "displayName": "Locations Slider",
        "description": "Locations slider using the table 'Place' as the data source",
        "tables": ["cre10_demoytcarousel"],
        "params": [
            {
            "id": "title",
            "displayName": "Title",
            "description": ""
        },{
            "id": "interval",
            "displayName": "Interval",
            "description": "The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle. Default: 5000ms"
        },{
            "id": "count",
            "displayName": "Count",
            "description": "The number of locations to display"
        },{
            "id": "height",
            "displayName": "Slide's height",
            "description": "In px, default: 500px"
        }
      ]
    }
{% endmanifest %}

 

Categories:
  • Harikiran_K Profile Picture
    on at
    Re: Image carousel not working

    I am also facing the same error where images are displaying and the text seems to be greyed out. I referred the same video that you have mentioned. Could you please let me know how were you able to resolve the issue.

    Harikiran_K_0-1721118113840.png

    The code that I have used for web-template is as below:

    {% fetchxml locationsQuery %}
        <fetch mapping='logical'>
        <entity name='cr109_demoprcarousel'>
            <attribute name='cr109_name' />
            <attribute name='cr109_description' />
            <attribute name='cr109_carouseluimage_url' />
        </entity>
        </fetch>
    {% endfetchxml %}

    <h2>{{ title | default: "Locations" }}</h2>

    {% assign interval = interval | integer %}
    {% assign count = count | integer %}
    {% assign height = height | integer %}

    <span>Showing {{ count }} out of {{ locationsQuery.results.entities.size }}</span>
    {% if locationsQuery.results.entities.size > 0 %}
        <div id="carousel-example-generic"
        class="carousel slide"
        data-ride="carousel"
        data-interval="{{interval}}">
        <!-- Indicators -->
        <ol class="carousel-indicators">
            {% for location in locationsQuery.results.entities limit: count %}
            <li
                data-target="#carousel-example-generic"
                data-slide-to="{{forloop.index0}}"
                class="{% if forloop.first %}active{% endif %}"></li>
            {% endfor %}
        </ol>
        <!-- Wrapper for slides -->
        <div class="carousel-inner" role="listbox">
            {% for loc in locationsQuery.results.entities limit: count %}
            <div class="item {% if forloop.first %}active{% endif %}" style="background-image:url('{{loc.cr109_carouseluimage_url}}&Full=true'); height: {{height | default:500}}px">
                <div class="carousel-caption" style="background:white">
                <h3>{{ loc.cr109_name }}</h3>
                <p>{{ loc.cr109_description }}</p>
                </div>
            </div>
            {% endfor %}
        </div>
        <!-- Controls -->
        <a
            class="left carousel-control"
            href="#carousel-example-generic"
            role="button"
            data-slide="prev">
            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a
            class="right carousel-control"
            href="#carousel-example-generic"
            role="button"
            data-slide="next">
            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
        </div>
    {% endif %}

    <style>
        .carousel .item {
        background-size: cover;
        background-repeat: no-repeat;
        }
    </style>

    {% manifest %}
        {
        "type": "Functional",
            "displayName": "Locations Slider",
            "description": "Locations slider using the table 'Place' as the data source",
            "tables": ["cr109_demoprcarousel"],
            "params": [
                {
                "id": "title",
                "displayName": "Title",
                "description": ""
            },{
                "id": "interval",
                "displayName": "Interval",
                "description": "The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle. Default: 5000ms"
            },{
                "id": "count",
                "displayName": "Count",
                "description": "The number of locations to display"
            },{
                "id": "height",
                "displayName": "Slide's height",
                "description": "In px, default: 500px"
            }
          ]
        }
    {% endmanifest %}
     
  • mfregier Profile Picture
    2 on at
    Re: Image carousel not working

    Hello,

    thanks for your help and your feedback.

    I tried to change the glyphicon class and now there are two "magnifying-glass" that appear (see picture).

     

    However, regarding the picture, I already have the two pictures show in the same time.

    Do you know what is the reason?

     

    Moreover, I follow this tutorial https://www.youtube.com/watch?v=y8DcDlZIzOg and when he added the include of the web template in the HTML code, he had a liquid error (due to permission). I do not have this error. Furthermore, after when he set the permission, a gray front with arrows appeared. So, is it possible that the liquid framework is not activated in my environment ?

     

    Thanks.

  • Fubar Profile Picture
    7,966 Super User 2025 Season 1 on at
    Re: Image carousel not working

    Suspect the glyphicon class is not correct (or present), try replacing the entries in the class= for next and prev to see if you get something

    class="glyphicon fa-solid fa-magnifying-glass"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43