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
/// <summary> | |
/// </summary> | |
/// <param name="pageReference"></param> | |
/// <param name="isInEditMode"></param> | |
/// <returns></returns> | |
public static IEnumerable<PageData> GetChildren(PageReference pageReference, bool isInEditMode) | |
{ | |
IEnumerable<PageData> pages = null; | |
try |
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
location = CallGeoTaggingService(address); | |
if (location != null) | |
{ | |
var dp = new DataProvider(ReturnFields.All); | |
var itemToEdit = dp.GetItem(itemUrl); | |
if (itemToEdit.Editable) | |
{ | |
itemToEdit.ForceEditState(); |
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
public SearchByIndex(string indexName) | |
{ | |
ExamineManager.Instance.TryGetIndex(indexName, out var index); | |
var searcher = index.GetSearcher(); | |
ISearchResults results = searcher | |
.CreateQuery() | |
.Field("__Published", "n") | |
.Execute(); | |
return results; |
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
public class ScheduledPosts | |
{ | |
private readonly IContentService _contentService; | |
public ContentServiceHelper( | |
IContentService contentService) | |
{ | |
_contentService = contentService; | |
} | |
} |
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 results = SearchByIndex("TutorialIndex"); | |
using (var umbracoContextReference = _umbracoContextFactory.EnsureUmbracoContext()) | |
{ | |
foreach (var result in results) | |
{ | |
var contentPage = _contentService.GetById(Convert.ToInt32(result.Id)); | |
if (contentPage == null) | |
{ | |
continue; | |
} |
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
{ | |
"name": "my-package", | |
"dependencies": { | |
"packageOne":"~1.0.1", | |
"packageTwo":"2.0.1" | |
} | |
} |
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
{ | |
"name": "packageOne", | |
"dependencies": | |
{ | |
"packageTwo": "^3.0.0" | |
} | |
} |
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
{ | |
"name": "my-package", | |
"dependencies": { | |
"packageOne":"~1.0.1", | |
"packageTwo":"2.0.1" | |
} | |
"resolutions": { | |
"packageTwo": "^2.0.0", | |
} | |
} |
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
public class ObjectToReturn | |
{ | |
public string SomeData { get; set; } | |
} |
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
public class MyApiController : UmbracoApiController | |
{ | |
[HttpGet] | |
public JsonResult<List<SomeData>> GetJson() | |
{ | |
var json = new List<PostInfo>(); | |
// call umbraco, get data, do whatever | |
return Json(json); |
OlderNewer