Created
June 25, 2017 21:11
-
-
Save charlesroper/25ba26c442523834500d9e12e80a760b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits UmbracoViewPage<IRelatedLinks> | |
@{ | |
var linkCards = Model.LinkCards; | |
var linkCardsAreEnabled = Model.RelatedLinksEnabled; | |
if (linkCards == null || !linkCardsAreEnabled) | |
{ | |
linkCards = Model.Parent.GetPropertyValue<IEnumerable<IPublishedContent>>("linkCards", true); | |
linkCardsAreEnabled = Model.Parent.GetPropertyValue<bool>("relatedLinksEnabled", true); | |
} | |
if (linkCards != null && linkCardsAreEnabled) | |
{ | |
<div class="related-links"> | |
<h3 class="decorative-heading" id="related-links">Related Links</h3> | |
<ul class="card-nav-list"> | |
@foreach (var linkCard in linkCards) | |
{ | |
var url = linkCard.GetPropertyValue<Link>("cardLink").Url; | |
var image = linkCard.GetPropertyValue<IPublishedContent>("cardImage"); | |
<li class="card"> | |
<a href="@url"> | |
<div class="image"> | |
<img src="@image.GetCropUrl("thumbnail")" width="280" height="144" | |
alt="@image.GetPropertyValue("cardImageAltText")" /> | |
</div> | |
<h2>@linkCard.Name</h2> | |
<p>@linkCard.GetPropertyValue("cardText")</p> | |
</a> | |
</li> | |
} | |
</ul> | |
</div> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment