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
public class InitialiseHost | |
{ | |
public virtual void Process(PipelineArgs args) | |
{ | |
Host.Get("default").ResolveLocalUser = (host, resolveArgs) => | |
{ | |
if (Context.User == null || !Context.User.IsAuthenticated) | |
return null; | |
return new LocalUser(Context.User.LocalName, Context.User.Profile.Email); |
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
public class TelligentRestHost : Telligent.Evolution.Extensibility.Rest.Version1.RestHost | |
{ | |
private string _communityUrl = null; | |
private string _adminAPIKey = null; | |
private string _adminUserName = null; | |
private bool _impersonate = false; | |
private string _impersonateUsername = null; | |
private string _requestTimeoutSeconds = null; | |
public TelligentRestHost(string communityUrl, string adminUserName, string adminApiKey, bool impersonate, string requestTimeoutSeconds, string impersonateUsername = "") |
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
public class MvcBrowserCaching : GetPageRenderingProcessor | |
{ | |
public override void Process(GetPageRenderingArgs args) | |
{ | |
Assert.ArgumentNotNull((object)args, "args"); | |
Profiler.StartOperation("Update browser caching headers."); | |
HttpContext currentContext = HttpContext.Current; | |
Item currentItem = PageContext.CurrentOrNull.Item; | |
if (currentContext == null) |
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 System.Web.Mvc | |
@using System.Web.Mvc.Html | |
@model TcDemo.Models.TcBlogPost | |
<section> | |
@foreach (TcDemo.Models.TcBlogPost post in Model){ | |
<div> | |
<h1> | |
<a href="@post.Url">@Html.Raw(post.Title)</a> | |
</h1> |
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
public class TcBlogPost : TcPostBase | |
{ | |
public string Slug { get; set; } | |
public string Title { get; set; } | |
public string TitleUrl { get; set; } | |
public string PublishedDate { get; set; } | |
public string ExcerptSize { get; set; } | |
public string UsePostSummary { get; set; } | |
public string GeneratePostSummary { get; set; } | |
public string BlogId { get; set; } |
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
public class TcPostBase | |
{ | |
public string Id { get; set; } | |
public string ContentId { get; set; } | |
public string ContentTypeId { get; set; } | |
public string Url { get; set; } | |
public string Excerpt { get; set; } | |
public string Body { get; set; } | |
public string GroupId { get; set; } | |
public string IsFeatured { get; set; } |
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
$rootItem = Get-Item -Path "/sitecore/templates/Site1/Pages" #update to the path with your page templates | |
$deviceLayout = Get-LayoutDevice "Default" #update to device layout you wish to target | |
$templateMode = $True #set to False to update pages instead of templates (usually you will want to update template standard values) | |
$useFinalLayout = $False #set to True to use FinalRenderings instead of Renderings field | |
$checkForLayout = $False #set to True to skip items with no layout (use only for updating pages and not templates) | |
$updateDataSourcesOnly = $False #set to True to only update datasources and not swap or delete renderings | |
$reportMode = $False #set to True to just output info on renderings to be swapped/deleted/updated | |
$modeType = "" | |
$placeholder = "main" #update to use the placeholder your renderings exist in | |
$renderingIdToSwap = "{15BCE4DA-4F3C-42CA-9D4D-D46D572C7A8F}" #update to the rendering id you wish to swap out |
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
public class CustomDropDownList : DropList | |
{ | |
private static readonly string BaseCssClassName = "scfCustomlistBorder"; | |
[ParameterName("emptychoicetext")] | |
[VisualCategory("Custom")] | |
[VisualProperty("Empty Choice Text:")] | |
public string EmptyChoiceText { get; set; } | |
[ParameterName("showemptychoice")] |
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
public class CustomDropDownListField : DropListField | |
{ | |
public CustomDropDownListField() | |
{ | |
//initalise services here | |
} | |
private string InitialSelection { get; set; } | |
public override void Initialize() |
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
function Swap-Rendering ($item, $renderingToSwapOut, $placeholder, $renderingIdToAdd, $renderingDataSourceIdToAdd, $useFinalLayout) { | |
$renderingItem = Get-Item -Path $renderingToSwapOut.ItemID | |
Write-Host "Swaping Rendering: $($renderingToSwapOut.UniqueID) - '$($renderingItem.Name)' in Placeholder: $($placeholder) to: $($renderingIdToAdd) - '$($renderingToAdd.Name)' for Item: $($item.Name)" | |
$renderingToSwapOut.ItemID = $renderingIdToAdd | |
if($renderingDataSourceToAdd){ | |
$renderingToSwapOut.Datasource = $renderingDataSourceToAdd | |
} | |
Set-Rendering -Item $item -Instance $renderingToSwapOut -FinalLayout:$useFinalLayout | |
} |