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.Web.Routing; | |
using Umbraco.Core.Composing; | |
using Umbraco.Web.Runtime; | |
namespace RemoveRoutes | |
{ | |
// This is required to ensure this composer runs after | |
// Umbraco's WebFinalComposer which is the component | |
// that creates all of the routes during startup | |
[ComposeAfter(typeof(WebFinalComposer))] |
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
RouteTable.Routes.MapRoute("Default", "{controller}/{action}/{id}", | |
//Defaults | |
new { controller = "Home", action = "Index", id = "" }, | |
//Constraints (controller cannot start with UmbProfile, UmbRegister, UmbLogin, UmbLoginStatus or Tags) | |
new { controller = "^(?!(UmbProfile|UmbRegister|UmbLogin|UmbLoginStatus|Tags))" }); |
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 Awesome.FormDemo.Controllers | |
@model Awesome.FormDemo.Models.TicketOrderModel | |
@if (TempData.ContainsKey("CustomMessage")) | |
{ | |
<div>Hooray! - @TempData["CustomMessage"]</div> | |
} | |
else | |
{ | |
using (Html.BeginUmbracoForm<TicketOrderController>("FormSubmit")) |
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 Umbraco.Core; | |
using Umbraco.Core.Services; | |
namespace My.Namespace | |
{ | |
public class EventHandler : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ |
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
// MODEL | |
using System.Collections.Generic; | |
using System.Linq; | |
using Umbraco.Core.Models; | |
using Umbraco.Web; | |
using Umbraco.Web.Models; | |
namespace Cultiv.Models | |
{ | |
public class BlogOverview : RenderModel |
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
@inherits UmbracoTemplatePage | |
@{ | |
Response.ContentType = "text/xml"; | |
// The variables in this code block are the only ones you might need to change a little to get it to work | |
var blogName = "Cultiv"; | |
var currentUrl = string.Format("https://{0}", Request.Url.Host); | |
// Find first node under the root of document type BlogOverview | |
var blogNode = Model.Content.AncestorOrSelf(1).Descendants("BlogOverview").First(); |
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.Linq; | |
using System.Web.Mvc; | |
using Umbraco.Course.Models; | |
using Umbraco.Web.Mvc; | |
namespace Awesome.FormDemo.Controllers | |
{ | |
public class TicketOrderController : SurfaceController | |
{ |
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
<dependentAssembly> | |
<assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | |
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" /> | |
</dependentAssembly> | |
<dependentAssembly> | |
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | |
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" /> | |
</dependentAssembly> |
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 static Guid GetKey(this IPublishedContent content) | |
{ | |
IPublishedContent um = content; | |
var wrapped = um as PublishedContentExtended; | |
while (wrapped != null) | |
wrapped = (um = wrapped.Unwrap()) as PublishedContentExtended; | |
var contentWithKey = um as IPublishedContentWithKey; | |
return contentWithKey == null ? Guid.Empty : contentWithKey.Key; | |
} |
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
<system.net> | |
<mailSettings> | |
<smtp deliveryMethod="SpecifiedPickupDirectory" from="info@test.com"> | |
<network host="localhost" /> | |
<specifiedPickupDirectory pickupDirectoryLocation="D:\Temp\Umbraco-CMS\src\Umbraco.Web.UI\App_Data\mail\" /> | |
</smtp> | |
</mailSettings> | |
</system.net> |