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
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Web; | |
using Umbraco.Core.Models; | |
using Umbraco.Web.Models; | |
namespace Umbraco.Course.Models | |
{ |
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
using System.Linq; | |
using System.Web.Http; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using Umbraco.Core; | |
namespace MyNamespace | |
{ | |
public class MyApplicationEventHandler : ApplicationEventHandler | |
{ |
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 Stream : RenderModel | |
{ | |
public Stream(IPublishedContent content, CultureInfo culture) | |
: base(content, culture) {} | |
public int Page { get; set; } | |
public int TotalPages { get; set; } | |
public int PreviousPage { get; set; } | |
public int NextPage { get; set; } | |
public bool IsFirstPage { get; set; } | |
public bool IsLastPage { 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
entityResource.getById(1120, "Content").then( | |
function(ent) { | |
$scope.nodeUrl = ent.urls[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
// Get the type by type alias (aka. document type alias) | |
var type = Services.ContentTypeService.GetContentType("statusUpdate"); | |
// Get the 10 latest nodes (based on create date) of the type from the "type"-object | |
// and create a list of StatusUpdates | |
var statusUpdates = Services.ContentService | |
.GetContentOfContentType(type.Id).OrderByDescending(x => x.CreateDate).Take(10); | |
var content = new List<StatusUpdate>(); | |
foreach (var statusUpdate in statusUpdates) | |
{ | |
// If the memberId is 0, then the posted was made when anonymous posts were still |
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
using System.ComponentModel.DataAnnotations; | |
namespace Awesome.FormDemo.Models | |
{ | |
public class TicketOrderModel | |
{ | |
public TicketOrderModel() | |
{ | |
StepIndex = 0; | |
PersonalInfoStep = new PersonalInfoStep(); |
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
using System.Configuration; | |
using System.Web.Mvc; | |
using Umbraco.Web.Mvc; | |
using Umbraco.Web.UI.Umbraco.Controls; | |
namespace My.Controllers | |
{ | |
public class MyUpdateController : SurfaceController | |
{ | |
public ActionResult Create(SomeModel model) |
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 contentService = UmbracoContext.Application.Services.ContentService; | |
var content = contentService.GetById(Model.Content.Id); | |
var currentValue = content.GetValue<bool>("myProp"); | |
content.SetValue("myProp", !currentValue); | |
contentService.SaveAndPublishWithStatus(content); |
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
dir | Rename-Item -NewName { $_.Name.Substring(1, $_.Name.Length - 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
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet | |
version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:msxml="urn:schemas-microsoft-com:xslt" | |
xmlns:umbraco.library="urn:umbraco.library" | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:content="http://purl.org/rss/1.0/modules/content/" | |
exclude-result-prefixes="msxml umbraco.library"> |