This file contains hidden or 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 (Model.StartPage.HeaderTopLinks != null) | |
{ | |
foreach (var link in Model.StartPage.HeaderTopLinks) | |
{ | |
<li> | |
<a href="@Url.ContentUrl(link.Href)" title="@link.Title">@link.Text</a> | |
</li> | |
} | |
} |
This file contains hidden or 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
<%= formBusinessService.ToHtmlStringWithFriendlyUrls(new XhtmlString(item.Caption)) %> <%--The only difference we have is "=" to allow raw markup(such as links) in the labels.--%> |
This file contains hidden or 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
let resizeId; | |
window.addEventListener('resize', () => { | |
clearTimeout(resizeId); | |
resizeId = setTimeout(allowProductGalleryNavDrag, 500); | |
}); |
This file contains hidden or 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
CreateMetaField(OrderContext.MetaDataContext, "LineItem", "ColorCode", "Color Code", MetaDataType.VarChar, 25, true, false); | |
private void CreateMetaField(MetaDataContext metaDataContext, string nameSpace, string name, string friendlyName, MetaDataType type, int length, bool allowNulls, bool cultureSpecific) | |
{ | |
//public static MetaField Create( | |
//MetaDataContext context, | |
//string metaNamespace, | |
//string name, | |
//string friendlyName, |
This file contains hidden or 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
import React, { Component } from 'react'; | |
class Comp1 extends Component { | |
render() { | |
return ( | |
<div></div> | |
); | |
} | |
} |
This file contains hidden or 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
//Нашел где-то на стэк оверфлоу | |
export const formatMoney = (amount, decimalCount = 2, decimal = ".", thousands = ",") => { | |
try { | |
decimalCount = Math.abs(decimalCount); | |
decimalCount = isNaN(decimalCount) ? 2 : decimalCount; | |
const negativeSign = amount < 0 ? "-" : ""; | |
let i = parseInt(amount = Math.abs(Number(amount) || 0).toFixed(decimalCount)).toString(); | |
let j = (i.length > 3) ? i.length % 3 : 0; |
This file contains hidden or 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
export const redirectWithPayload = (url = "", payload = {}) => { | |
const f = document.createElement('form'); | |
f.method = 'post'; | |
f.action = url; | |
Object.keys(payload).forEach(function(key) { | |
const i = document.createElement('input'); | |
i.name = key; | |
i.type = 'hidden' |
This file contains hidden or 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
private readonly IContentLoader _contentLoader; | |
private readonly UrlResolver _urlResolver; | |
public PageController(IContentLoader contentLoader) | |
{ | |
_contentLoader = contentLoader; | |
_urlResolver = ServiceLocator.Current.GetInstance<UrlResolver>(); | |
} |
This file contains hidden or 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
using System.Web.Mvc; | |
using SomeName.Project.Areas.Layout.Models; | |
using SomeName.Project.Areas.Layout.ViewModels; | |
using EPiServer.Shell; | |
using EPiServer.Web.Mvc; | |
namespace SomeName.Project.Areas.Layout.Controllers | |
{ |