This file contains hidden or 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
## Add this snippet to your profile script | |
## Profile script is usually found in | |
## c:\Users\yourname\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 | |
## You can get the path by typing $PROFILE in a PS command prompt | |
## | |
## After adding the script to your profile, unpack the zip file in a directory | |
## Go to the dir in ps, and type "umbpack" then Enter (without quotes) | |
## Now you can find all the packages original files with their original (unpacked) names | |
## in the original folders | |
function global:Build-UmbracoPackage { |
This file contains hidden or 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.NodeFactory; | |
using umbraco.interfaces; | |
namespace NyborgBy.Repositories.Entities | |
{ | |
public abstract class NodeItem | |
{ | |
protected NodeItem() | |
{ | |
} |
This file contains hidden or 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
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" | |
CodeBehind="Master.master.cs" Inherits="Web.masterpages.Master" %> | |
<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolderDefault"><!doctype html> | |
<html class="no-js" lang="en"> | |
<head> | |
</head> | |
<body> | |
</body> | |
<!-- |
This file contains hidden or 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
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" | |
CodeBehind="Master.master.cs" Inherits="Web.masterpages.Master" %> | |
<!-- | |
This is the "root" master page that all other masterpages | |
in the website is based upon. | |
--> | |
<asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolderDefault"><!doctype html> | |
<html class="no-js" lang="en"> | |
<head> | |
</head> |
This file contains hidden or 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 umbraco.MacroEngines.DynamicNodeContext | |
@if (Parameter.MyCustomParameter == "showThisNotThat") | |
{ | |
<div>@Model.MyProperty</div> | |
} |
This file contains hidden or 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
var urlItem = node.GetProperty<string>("urlItemAlias"); | |
var urlPickerState = uComponents.Core.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize(urlItem); | |
var url = urlPickerState.Url; | |
var title = urlPickerState.Title; |
This file contains hidden or 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
// Put this file in /App_Start | |
using Twins.UmbWebApi.App_Start; | |
using System.Web.Http; | |
using System.Web.Routing; | |
[assembly: WebActivator.PreApplicationStartMethod(typeof (AppStart), "RegisterRoutes")] | |
namespace YourProject.UmbWebApi.App_Start | |
{ | |
public class AppStart | |
{ |
This file contains hidden or 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="[email protected]"> | |
<specifiedPickupDirectory pickupDirectoryLocation="C:\temp\mailpickup"/> | |
</smtp> | |
</mailSettings> | |
</system.net> |
This file contains hidden or 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
# Backup your umbraco.io db to local machine with this powershell script | |
# based on a connection string looking like this | |
# server=xxxxxx.database.windows.net,1433;database=xxxxxx;user id=xxxxxx;password=xxxxxx | |
# | |
$dbserver = 'xxxxxx.database.windows.net,1433' | |
$dbname = 'xxxxxx' | |
$username = 'xxxxxx' | |
$password = 'xxxxxx!' | |
$timestamp = Get-Date -Format 'yyyyMMddTHHmmss' | |
& sqlpackage /a:export /ssn:"$dbserver" /sdn:"$dbname" /su:"$username" /sp:"$password" /tf:"xxxprojectnamexxx-$timestamp.bacpac" |
This file contains hidden or 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
private readonly IMediaService _mediaSvc = ApplicationContext.Current.Services.MediaService; | |
// Updating profile pic | |
internal void UpdateProfilePic(int profileId, string picPath) | |
{ | |
if (profileId == 0) throw new ArgumentException("Error updating profile, no profile id in request"); | |
var contentItem = _contentSvc.GetById(profileId); | |
// Set mediaitem | |
var mediaFilename = contentItem.Name + Path.GetExtension(picPath); |
OlderNewer