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 umbraco.cms.businesslogic.web | |
@* A Razor script to add a basic comment function to Umbraco pages | |
You need a document type called Comment with a textstring property | |
called commentName and a textbox multiple property called commentMessage | |
You also need to allow the Comment document type as child document type | |
to your textpage document type. | |
Create this script with a macro and add it below the bodyText in your | |
template(s) *@ |
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 api/books | |
public IHttpActionResult Get() | |
{ | |
return Ok(_repository.GetBooks().AsEnumerable()); | |
} | |
// GET api/books/1 | |
public IHttpActionResult Get(int id) | |
{ | |
var book = _repository.GetBook(id); |
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
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/ | |
/*At least requires the meta viewport tag with content 'width=device-width'*/ | |
@media only screen and (max-width: 1080px) and (orientation : portrait) { | |
/* PORTRAIT: | |
Windows Surface Pro*/ | |
} | |
@media only screen and (max-width: 800px) and (orientation : portrait) { | |
/* PORTRAIT: | |
Acer Iconia Tab A100 |
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.Text.RegularExpressions; | |
namespace DalesLab.Helpers | |
{ | |
public static class Parser | |
{ | |
public static readonly Regex VimeoVideoRegex = new Regex(@"vimeo\.com/(?:.*#|.*/videos/)?([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Multiline); | |
public static readonly Regex YoutubeVideoRegex = new Regex(@"youtu(?:\.be|be\.com)/(?:(.*)v(/|=)|(.*/)?)([a-zA-Z0-9-_]+)", RegexOptions.IgnoreCase); | |
public static readonly Regex HyperlinkRegex = new Regex("http(s)?://([\\w+?\\.\\w+])+([a-zA-Z0-9\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)_\\-\\=\\+\\\\\\/\\?\\.\\:\\;\\'\\,]*)?", RegexOptions.IgnoreCase); //http://weblogs.asp.net/farazshahkhan/regex-to-find-url-within-text-and-make-them-as-link |
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 Ninject; | |
using Umbraco.IocTest.BLL.Providers; | |
using Umbraco.IocTest.Core.Interfaces; | |
namespace Umbraco.IocTest.BLL | |
{ | |
/// <summary> | |
/// The CommonServices are services that are a 1:1 pair with an implemnting class. | |
/// For example: A single provider interface can only have one implmentation, | |
/// thus this is registered in the common services. |
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 Umbraco.Web.Mvc; | |
namespace Endzone.Umbraco.PatternLib | |
{ | |
public class PatternLibRazorViewEngine : RenderViewEngine | |
{ | |
public PatternLibRazorViewEngine() : base() | |
{ | |
/* |
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 Umbraco.Core.Models.PublishedContent; | |
using Umbraco.Web; | |
using Vendr.Core.Calculators; | |
using Vendr.Core.Models; | |
using Vendr.Core.Services; | |
using Vendr.Web.Models; | |
namespace Vendr.DemoStore.Web.Calculators |
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
/* jshint esversion: 8 */ | |
// This example is a port of: https://gist.github.com/diazvictor/6fe3372bce79587a3c21123a19881cb1 | |
// I create the Inventory class | |
class Inventory { | |
// What to do when the class is initialized | |
constructor() { | |
this.items = []; | |
} |
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
@* | |
Demonstration of using the Umbraco Forms 13 API for retrieving the definition of a form, rendering it and posting an entry. | |
It's based off an Umbraco content item with a property with alias "Form", of type "Form Picker". | |
*@ | |
@using Microsoft.AspNetCore.Antiforgery | |
@using Microsoft.Extensions.Options; | |
@using Umbraco.Cms.Web.Common.PublishedModels; | |
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.AJaxformPage> | |
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels; |
OlderNewer