Skip to content

Instantly share code, notes, and snippets.

@bootnumlock
bootnumlock / ezSearchBootstrapper.cs
Last active February 7, 2018 13:04
gathering node code for segal archetype implimentation
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Web;
using Archetype.Models;
using Examine;
using Newtonsoft.Json;
using Umbraco.Core;
@bootnumlock
bootnumlock / sendRFPmail.cshtml
Created January 31, 2017 22:52
sending mail with attachment
@using System;
@using System.Net.Mail;
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
HttpContext.Current.Response.Write("starting up...");
string firstName = Request["firstName"];
string lastName = Request["lastName"];
string thePosition = Request["thePosition"];
@bootnumlock
bootnumlock / createMember.cs
Created February 21, 2016 16:42
create member
public int RegisterMember(string memberName, string emailAddress, string memberPassword, string memberTypeAlias, string memberGroupName)
{
int umbracoMemberId = -1;
if (!MemberExists(emailAddress))
{
IMember newMember = ApplicationContext.Current.Services.MemberService.CreateMember(emailAddress, emailAddress, memberName, memberTypeAlias);
try
{
@bootnumlock
bootnumlock / statementEdit.cshtml
Created February 21, 2016 16:39
edit node data
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using Umbraco.Core;
@using Umbraco.Core.Models;
@using Umbraco.Core.Services;
@using System.Web.Mvc.Html
@using ClientDependency.Core.Mvc
@using Umbraco.Web
@using Umbraco.Web.Models
@bootnumlock
bootnumlock / createStatement.cshtml
Created February 21, 2016 16:38
node creation example
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using Umbraco.Core;
@using Umbraco.Core.Models;
@using Umbraco.Core.Services;
@using System.Web.Mvc.Html
@using ClientDependency.Core.Mvc
@using Umbraco.Web
@using Umbraco.Web.Models
@bootnumlock
bootnumlock / mainPageBoxes.cshtml
Created December 10, 2015 15:14
Archetype example of main page boxes
@inherits Umbraco.Web.Mvc.UmbracoViewPage<ArchetypeFieldsetModel>
@using Archetype.Models;
@using System.Text;
@using System.Text.RegularExpressions;
@using System.Web;
@{
var showAll = "";
string DomainName = HttpContext.Current.Request.Url.Host;
@bootnumlock
bootnumlock / sideBarContentReFactor.cshtml
Last active December 10, 2015 18:47
Refactored version of the sidebar content
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
int z=1;
string theStatus = "";
if(Request.Cookies["visitorStatus"] != null) {
theStatus= Request.Cookies["visitorStatus"].Value;
@bootnumlock
bootnumlock / sidebarContentBelowBAD.cshtml
Created December 10, 2015 13:58
pre refactor for sidebar content items
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var vidRatio = "16by9";
int z=1;
string theStatus = "";
if(Request.Cookies["visitorStatus"] != null) {
theStatus= Request.Cookies["visitorStatus"].Value;
@bootnumlock
bootnumlock / orders.cs
Created November 24, 2015 17:17
Would love some teaching here
using System;
using Umbraco.Core;
using Umbraco.Core.Events;
using Umbraco.Core.Models;
using Umbraco.Core.Publishing;
using Umbraco.Core.Services;
using System.Web.Mvc.Html;
using Umbraco.Web;
using Umbraco.Web.Models;
@bootnumlock
bootnumlock / paginationExample.cshtml
Created October 20, 2015 13:13
Pagination example as posted by Janae Cram on stackoverflow http://stackoverflow.com/questions/24906410/umbraco-pagination
@{
var pageSize = 8;
if(Model.Content.HasValue("numberOfItemsPerPage")){
pageSize = Model.Content.GetPropertyValue<int>("numberOfItemsPerPage");}
var page = 1; int.TryParse(Request.QueryString["page"], out page);
var items = Umbraco.TypedContent(Model.Content.Id).Children.Where(x => x.DocumentTypeAlias == "exampleAlias" && x.IsVisible()).OrderByDescending(x => x.CreateDate);
var totalPages = (int)Math.Ceiling((double)items.Count() / (double)pageSize);
if (page > totalPages)