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
List<Item> items = (Sitecore.Context.Item.Axes.SelectItems(query) ?? new Item[] { }).ToList(); |
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
ids.ForEach(id => { | |
itineraries.Add(Sitecore.Context.Database.GetItem(id)); | |
}); |
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
<ul> | |
<asp:Repeater ID="rpFooterDestinations" runat="server"> | |
<ItemTemplate> | |
<li> | |
<a href="<%# Sitecore.Links.LinkManager.GetItemUrl( | |
(Sitecore.Data.Items.Item) Container.DataItem | |
) %>"><%# Eval("DisplayName") %></a> | |
</li> | |
</ItemTemplate> | |
</asp:Repeater> |
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
var market = MarketInfo.Markets.SingleOrDefault(m => m.Code == Visitor.CountryCode); | |
if (market == null) | |
market = Visitor.Market; |
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
var p = Html.Sitecore().CurrentRendering.Parameters; | |
bool fullWidth = (p["Full width"] == "1") ? true : false; | |
string widthClass = (fullWidth) ? "fullwidth" : "indented"; |
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
ImageField field = context.Fields["Img"]; | |
if (field != null && field.MediaItem != null) | |
{ | |
var ImgItem = new Sitecore.Data.Items.MediaItem(field.MediaItem); | |
var ImgUrl = Sitecore.Resources.Media.MediaManager.GetMediaUrl(ImgItem); | |
var ImgCaption = field.Alt; | |
} |
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
// define how many items we want per chunk | |
var itemsPerChunk = 3; | |
// break the list of items into chunks | |
var chunks = items.Select((s, i) => new { Value = s, Index = i }).GroupBy(item => item.Index / itemsPerChunk, item => item.Value); | |
// iterate through each chunk | |
foreach (var chunk in chunks) | |
{ | |
<div class="row"> |
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
/* | |
* if C2 contains a DateTimeOffset eg 2015-08-13 09:31:12.0000000 +01:00 | |
* parse the date and time out and add them together | |
* then subtract the hours offset (which - in Excel time storage is hours/24) | |
* note that this ignores the minute-part of an offset (eg Venezuela) | |
*/ | |
=DATE(LEFT($C2,4), MID($C2,6,2),MID($C2,9,2)) + TIME(MID($C2,12,2),MID($C2,15,2),MID($C2,18,2)) + (MID($C2,29,3)/24) |
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
$('#article-content').find('h1,h2,h3,h4,h5,h6').each(function(i,el) {console.log(i + "\t" + el.tagName + "\t" + $(el).text())}) |
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
@{ | |
LinkField URL = item.Fields["URL"]; | |
if (URL != null) | |
{ | |
<a href="@URL.Url" target="@URL.Target" title="@URL.Title">@URL.Title ></a> | |
} | |
} |
OlderNewer