Skip to content

Instantly share code, notes, and snippets.

@rbaty-barr
rbaty-barr / ajaxCall.js
Created September 24, 2018 15:54
the jquery to call
$('#support').click(function () {
$(this).fadeOut();
$.ajax({
async: true,
type: "POST",
url: "/umbraco/surface/votenowsurface/castvote",
data: "1",
dataType: "html"
})
.done(function (data) {
@rbaty-barr
rbaty-barr / updateNode.cs
Created September 24, 2018 15:27
update an umbraco node with a class
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
@rbaty-barr
rbaty-barr / helpers.cs
Created February 7, 2018 14:46
CSAC app_code helpers
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
@rbaty-barr
rbaty-barr / formsDocsMedia2.cshtml
Created December 1, 2017 19:43
forms and docs with mediapicker2
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var mediaRoot = Model.Content.GetPropertyValue<IPublishedContent>("formsAndDocs");
}
<div id="formsDocsArea">
@if(mediaRoot != null && Model.Content.GetPropertyValue<string>("asHideShow") == "True"){
foreach( var item in mediaRoot.Children()){
@rbaty-barr
rbaty-barr / gridContent.json
Last active October 17, 2017 14:20
indexing the grid
contentGrid:{
"name":"Main Layout",
"sections":[
{
"grid":12,
"rows":[
{
"name":"Single Cell Row",
"areas":[
{
@rbaty-barr
rbaty-barr / custom.js
Last active September 29, 2017 13:28
A class of helpers i am using for an intranet project
function getDateInfo(info) {
var test = info.toString();
$.ajax({
type: 'POST',
url: "/umbraco/surface/rendercalendar/listevents",
//contentType: "application/json; charset=utf-8",
data: {'matchThis': test},
datatype: "json",
success: function (data) {
console.log(data);
@rbaty-barr
rbaty-barr / grid.config
Created September 6, 2017 14:50
This is a sample of a custom pre-vaule editor that is a checkbox property for the grid
[
{
"label": "Show by state",
"description": "Show this row for the following states.",
"key": "state",
"view": "/App_Plugins/StatePicker/state-picker-list.html",
"applyTo": "row",
"defaultConfig": {
"selectMultiple": true,
"displaySelectInversed": true,
@rbaty-barr
rbaty-barr / bstrap4MainNav.cshtml
Last active August 24, 2017 18:25
bootstrap v4 basic navigation script for umbraco
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var homeActive = "active";
var homeUrl = @Model.Content.AncestorOrSelf(1);
}
<nav class="navbar navbar-expand-lg navbar-light bg-light" id="mainNav">
<button type="button" class="navbar-toggler w-100 border-0 text-left" data-toggle="collapse" data-target="#ba-nav" aria-controls="ba-nav" aria-expanded="false" aria-label="Toggle navigation">
@rbaty-barr
rbaty-barr / search.cshtml
Last active July 24, 2017 12:57
This is a first pass at some search scripting for us to use - note, there are some config file updates, but this is just for quick storage
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using System.Text
@using System.Text.RegularExpressions
@using Examine;
@using Examine.LuceneEngine.SearchCriteria;
@{
Layout = "InsideMain.cshtml";
}
@rbaty-barr
rbaty-barr / rewriteRule.xml
Last active July 19, 2017 17:02
Rewrite rules example for web.config
<rewrite>
<rules>
<rule name="orgRewrite" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^www\.(.+)$" />
</conditions>
<action type="Redirect" url="http://{C:1}/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
<rule name="Redirects umbraco.io to actual domain" stopProcessing="true">