Skip to content

Instantly share code, notes, and snippets.

@joeriks
joeriks / Comment.cshtml
Created March 19, 2011 16:51
Basic Umbraco Razor commentary form
@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) *@
@mfkp
mfkp / index.html
Created December 17, 2011 01:39
mailchimp ajax signup form example
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
@andyhuey
andyhuey / Mandrill.cs
Created August 24, 2012 00:43
sample code showing how to use the Mandrill API
/*
* Code/Mandrill.cs
* These are calls to the Mandrill email service.
* Reference: https://mandrillapp.com/api/docs/
*
* ajh 2012-08-09: new
*/
using System;
using System.Collections.Generic;
using System.Linq;
@jcanfield
jcanfield / googlemaps_canvas.html
Created September 20, 2012 03:40
Driving Directions URL for usage with Google Maps API and Custom infoWindow
<!DOCTYPE html>
<html>
<head>
<title>Google Maps API and Driving Directions</title>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">
function initialize() {
var myLatlng = new google.maps.LatLng(39.928294, -105.147710);
var mapOptions = {
zoom: 15,
@yetanotherchris
yetanotherchris / gist:4956622
Created February 14, 2013 21:36
Umbraco change templates on multiple documents
using System;
using System.Web;
using System.Web.Services;
using System.Collections;
using System.Web.Services.Protocols;
using umbraco.cms.businesslogic;
using umbraco.cms.businesslogic.web;
using umbraco.BusinessLogic;
using System.Xml.Serialization;
using umbraco.cms.businesslogic.property;
@pascalmaddin
pascalmaddin / parallax-image-with-text.html
Last active May 14, 2021 14:38
An Image with parallax-effect and with some text, which is fading out while scrolling
<div id="banner">
<div class="wrap-center">
<div class="banner-centered" id="banner-text">
<h2>Hello <strong>We Are Company-Name</strong>, Glad To See You. :-)</h2>
</div>
</div>
</div>
@derak-kilgo
derak-kilgo / brightcove-smartplayer-api-sample.html
Last active December 19, 2015 14:29
Brightcove Smart Player API Example
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Sample2</title>
<script language="JavaScript" type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div>
<p>Make sure you've got the dev console open or you won't see my messages.</p>
<button id="positionButton">Get position</button>
@warrenbuckley
warrenbuckley / XML-Snippet
Created July 31, 2013 09:15
Trying to create an XML Sitemap in Umbraco 6. Getting the following error: ============================================================ This page contains the following errors: error on line 9 at column 10: Extra content at the end of the document Below is a rendering of the page up to the first error.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = null;
Response.ContentType = "text/xml";
}<xml version="1.0" encoding="UTF-8">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2005-01-01</lastmod>
<changefreq>monthly</changefreq>
@ryanlewis
ryanlewis / Pager.cshtml
Created August 27, 2013 16:41
A Razor/ASP.NET MVC pager that is adaptable for any project (Developed for Umbraco)
@model Epiphany.Web.Models.PagerViewModel
@{
var showPages = 5;
var maxPage = (int) Math.Ceiling((decimal) Model.Total/Model.PageSize);
}
@*[[ PAGER PAGE:@Model.Page PAGESIZE:@Model.PageSize TOTAL:@Model.Total MAXPAGE:@maxPage ]]*@
<div class="pagination">
@csharpforevermore
csharpforevermore / App_Code-GlobalHelpers.cshtml
Created October 28, 2013 15:55
Umbraco 6 - Razor - Global helper wrapper method for rending a hyperlink
@helper RenderLink(string href, string title, string target, string text)
{
<a href="@(href)" title="@(title)" target="@(target)">@(text)</a>
}