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
public class MyApplication : Umbraco.Web.UmbracoApplication | |
{ | |
protected override void OnApplicationStarted(object sender, EventArgs e) | |
{ | |
umbracoPage.Init += (p, args) => | |
{ | |
var page = p as umbracoPage; | |
if (page == null) | |
return; | |
var request = page.Page.Request; |
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
public class SearchTable : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
base.ApplicationStarted(umbracoApplication, applicationContext); | |
Umbraco.Core.Services.ContentService.Published += (sender, args) => | |
{ | |
foreach (var content in args.PublishedEntities) | |
{ |
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 Umbraco.Core | |
@using uComponents.DataTypes.UrlPicker.Dto | |
@{ | |
//var items = Model.resourceLinks.Items as List<UrlPickerState>; | |
var items = new List<UrlPickerState> | |
{ | |
new UrlPickerState { Title = "Link1" }, | |
new UrlPickerState { Title = "Link2" }, | |
new UrlPickerState { Title = "Link3" }, | |
new UrlPickerState { Title = "Link4" }, |
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
public class ContextHelpers | |
{ | |
public static UmbracoContext EnsureUmbracoContext() { | |
if (UmbracoContext.Current != null) | |
{ | |
return UmbracoContext.Current; | |
} | |
var httpContext = new HttpContextWrapper(HttpContext.Current ?? new HttpContext(new SimpleWorkerRequest("temp.aspx", "", new StringWriter()))); | |
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
public bool TryFindContent(PublishedContentRequest contentRequest) | |
{ | |
if (contentRequest.Is404) | |
{ | |
var site = SiteHelpers.GetSite(); | |
var page404 = site.Get404Page(); | |
if (page404 != null) | |
{ | |
contentRequest.PublishedContent = contentRequest.RoutingContext.UmbracoContext.ContentCache.GetById(page404.Id); |
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
public void ReIndexEntity(IContentBase entity) | |
{ | |
if (entity is IContent) | |
{ | |
ExamineManager.Instance.ReIndexNode((entity as IContent).ToXml(), "content"); | |
} | |
else if (entity is IMedia) | |
{ | |
ExamineManager.Instance.ReIndexNode((entity as IMedia).ToXml(), "media"); | |
} |
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
public class UmbracoHooks : IApplicationEventHandler | |
{ | |
private static readonly List<int> PublishFixes = new List<int>(); | |
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
ContentService.Publishing += (sender, args) => | |
{ | |
foreach (var contentItem in args.PublishedEntities) | |
{ |
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
var contentService = ApplicationContext.Current.Services.ContentService; | |
var roots = contentService.GetRootContent(); | |
IContent nodeItem = null; | |
foreach (var root in roots) | |
{ | |
nodeItem = contentService.GetDescendants(root).FirstOrDefault(x => x.Properties.FirstOrDefault(y => y.Alias == "somePropertyAlias").Value.ToString() == "SomeValue"); | |
if (nodeItem != null) | |
break; | |
} |
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
declare @RowCount int, @tablename varchar(100) | |
declare @Tables table ( | |
PK int IDENTITY(1,1), | |
tablename varchar(100), | |
processed bit | |
) | |
INSERT into @Tables (tablename) | |
SELECT TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_TYPE = 'BASE TABLE' and TABLE_NAME not like 'dt%' order by TABLE_NAME asc | |
declare @Space table ( | |
name varchar(100), rows nvarchar(100), reserved varchar(100), data varchar(100), index_size varchar(100), unused varchar(100) |
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
var breakpoints = { | |
xs: 480, | |
sm: 768, | |
md: 992, | |
lg: 1200 | |
}, | |
currentWidth = 0, | |
currentBreakpoint = "", | |
breakpointMethods = []; // array of methods to be run whenever a breakpoint change is registered |