Skip to content

Commit

Permalink
Adding Link to Carousel Items
Browse files Browse the repository at this point in the history
  • Loading branch information
sjefvanleeuwen committed Oct 16, 2020
1 parent bd98b7c commit 33a912a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/Blazor.AdminLte.Site.Shared/Pages/Ui/General.razor
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
@code {
private CarouselItemCollection items = new CarouselItemCollection()
{
new CarouselItem(){Image="https://placehold.it/900x500/39CCCC/ffffff&text=I+Love+Bootstrap",Alt="First slide"},
new CarouselItem(){Image="https://placehold.it/900x500/39CCCC/ffffff&text=I+Love+Bootstrap",Alt="First slide",Link="/starter-pages/active-page?slide=1"},
new CarouselItem(){Image="https://placehold.it/900x500/3c8dbc/ffffff&text=I+Love+Bootstrap",Alt="Second slide"},
new CarouselItem(){Image="https://placehold.it/900x500/f39c12/ffffff&text=I+Love+Bootstrap",Alt="Third slide"},
new CarouselItem(){Image="https://placehold.it/900x500/f39c12/ffffff&text=I+Love+Bootstrap",Alt="Third slide",Link="/starter-pages/active-page?slide=3"},
};
private CarouselItemCollection items1 = new CarouselItemCollection()
{
new CarouselItem(){Image="https://placehold.it/900x500/2c8dbc/ffffff&text=I+Love+Bootstrap",Alt="First slide"},
new CarouselItem(){Image="https://placehold.it/900x500/2c8dbc/ffffff&text=I+Love+Bootstrap",Alt="First slide",Link="/starter-pages/active-page?slide=1"},
new CarouselItem(){Image="https://placehold.it/900x500/19CCCC/ffffff&text=I+Love+Bootstrap",Alt="Second slide"},
new CarouselItem(){Image="https://placehold.it/900x500/339c12/ffffff&text=I+Love+Bootstrap",Alt="Third slide"},
new CarouselItem(){Image="https://placehold.it/900x500/339c12/ffffff&text=I+Love+Bootstrap",Alt="Third slide",Link="/starter-pages/active-page?slide=3"},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<li data-target="#@Identifier" data-slide-to="@i" class='@(i==0 ? "active" : string.Empty)'></li>
}
</ol>

<div class="carousel-inner">

@for (int i = 0; i < Items.Count; i++)
{
<div class="carousel-item@(i == Items.Count - 1 ? " active carousel-item-left" : string.Empty) @(i==0 ? " carousel-item-next carousel-item-left" : string.Empty)">
<div class="carousel-item@(i == Items.Count - 1 ? " active carousel-item-left" : string.Empty) @(i==0 ? " carousel-item-next carousel-item-left" : string.Empty)">
<a href="@Items[i].Link">
<img class='d-block w-100' src="@Items[i].Image" alt="@Items[i].Alt">
</div>
</a>
</div>
}
</div>
<a class="carousel-control-prev" href="#@Identifier" role="button" data-slide="prev">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;

namespace Blazor.AdminLte
{
public class CarouselItem
{
public string Image { get; set; }
public string Alt { get; set; }

public string Link { get; set; } = "javascript:void(0)";
}

public class CarouselItemCollection : List<CarouselItem>
Expand Down

0 comments on commit 33a912a

Please sign in to comment.