Skip to content

Commit 33a912a

Browse files
Adding Link to Carousel Items
1 parent bd98b7c commit 33a912a

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/Blazor.AdminLte.Site.Shared/Pages/Ui/General.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
@code {
2828
private CarouselItemCollection items = new CarouselItemCollection()
2929
{
30-
new CarouselItem(){Image="https://placehold.it/900x500/39CCCC/ffffff&text=I+Love+Bootstrap",Alt="First slide"},
30+
new CarouselItem(){Image="https://placehold.it/900x500/39CCCC/ffffff&text=I+Love+Bootstrap",Alt="First slide",Link="/starter-pages/active-page?slide=1"},
3131
new CarouselItem(){Image="https://placehold.it/900x500/3c8dbc/ffffff&text=I+Love+Bootstrap",Alt="Second slide"},
32-
new CarouselItem(){Image="https://placehold.it/900x500/f39c12/ffffff&text=I+Love+Bootstrap",Alt="Third slide"},
32+
new CarouselItem(){Image="https://placehold.it/900x500/f39c12/ffffff&text=I+Love+Bootstrap",Alt="Third slide",Link="/starter-pages/active-page?slide=3"},
3333
};
3434
private CarouselItemCollection items1 = new CarouselItemCollection()
3535
{
36-
new CarouselItem(){Image="https://placehold.it/900x500/2c8dbc/ffffff&text=I+Love+Bootstrap",Alt="First slide"},
36+
new CarouselItem(){Image="https://placehold.it/900x500/2c8dbc/ffffff&text=I+Love+Bootstrap",Alt="First slide",Link="/starter-pages/active-page?slide=1"},
3737
new CarouselItem(){Image="https://placehold.it/900x500/19CCCC/ffffff&text=I+Love+Bootstrap",Alt="Second slide"},
38-
new CarouselItem(){Image="https://placehold.it/900x500/339c12/ffffff&text=I+Love+Bootstrap",Alt="Third slide"},
38+
new CarouselItem(){Image="https://placehold.it/900x500/339c12/ffffff&text=I+Love+Bootstrap",Alt="Third slide",Link="/starter-pages/active-page?slide=3"},
3939
};
4040
}

src/Blazor.AdminLte/UIElements/Accordian-Carousel/Carousel.razor

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<li data-target="#@Identifier" data-slide-to="@i" class='@(i==0 ? "active" : string.Empty)'></li>
88
}
99
</ol>
10-
1110
<div class="carousel-inner">
12-
1311
@for (int i = 0; i < Items.Count; i++)
1412
{
15-
<div class="carousel-item@(i == Items.Count - 1 ? " active carousel-item-left" : string.Empty) @(i==0 ? " carousel-item-next carousel-item-left" : string.Empty)">
13+
<div class="carousel-item@(i == Items.Count - 1 ? " active carousel-item-left" : string.Empty) @(i==0 ? " carousel-item-next carousel-item-left" : string.Empty)">
14+
<a href="@Items[i].Link">
1615
<img class='d-block w-100' src="@Items[i].Image" alt="@Items[i].Alt">
17-
</div>
16+
</a>
17+
</div>
1818
}
1919
</div>
2020
<a class="carousel-control-prev" href="#@Identifier" role="button" data-slide="prev">

src/Blazor.AdminLte/UIElements/Accordian-Carousel/Carousel.razor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
1+
using System.Collections.Generic;
42

53
namespace Blazor.AdminLte
64
{
75
public class CarouselItem
86
{
97
public string Image { get; set; }
108
public string Alt { get; set; }
9+
10+
public string Link { get; set; } = "javascript:void(0)";
1111
}
1212

1313
public class CarouselItemCollection : List<CarouselItem>

0 commit comments

Comments
 (0)