This file contains 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
$packageBackupName = "Sprint5"; | |
$package = new-package $packageBackupName; | |
$Author = [Sitecore.Context]::User.Profile.FullName; | |
$Publisher = [Sitecore.SecurityModel.License.License]::Licensee | |
$DayOfWeek = [datetime]::Now.DayofWeek | |
$package.Metadata.Author = $Author; | |
$package.Metadata.Publisher = $Publisher; | |
$package.Metadata.Version = ""; |
This file contains 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
##--INPUT --## | |
$customTemplateName = "test6"; | |
$baseTemplate="{1930BBEB-7805-47158AC7CF696}|{B7B41C45-2A6-E377DE778095}|{96224572-74-AE7E-DE43F0F6BFD9}"; | |
$layoutRenderings= | |
'<r xmlns:xsd="http://www.w3.org/2001/XMLSchema" > | |
<d id="{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}" l="{19432667-2790-44EC-9673-ACAE93AE0519}"> | |
<r id="{7915EF7B--7B0D39137443}" ph="metaheader" uid="{D36E7AFC-08B5-433C13-554B20BE9569}" /> | |
<r id="{016A19CB837-E81F2B510E72}" ph="breadcrumb" uid="{2ABC1220-6C40-426-B0A2-F594EEC98D7E}" /> | |
<r id="{C5CF5F45-F21BAE6-52DBC568E33A}" ph="navheader" uid="{DA646F0700E-B09A26C8}" /> | |
<r id="{93FA9D3A-590A-467C-872F-830C1D17E147}" ph="banner" uid="{8B8E75580AF0C-32620B307B5C}" /> |
This file contains 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
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title></title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> | |
<script> | |
$(function () { |
This file contains 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 static class FileExtension | |
{ | |
public static byte[] LoadUploadedFile(HttpPostedFileBase uploadedFile) | |
{ | |
var buf = new byte[uploadedFile.InputStream.Length]; | |
uploadedFile.InputStream.Read(buf, 0, (int)uploadedFile.InputStream.Length); | |
return buf; | |
} | |
} | |
Class ViewModel |
This file contains 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 static IList<int> GetFutureYears(int noOfYears) | |
{ | |
return Enumerable.Range(DateTime.Now.Year, noOfYears).ToList(); | |
} |
This file contains 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
static void Main(string[] args) | |
{ | |
DateTime today = DateTime.Parse("19/08/2016"); | |
DateTime effectiveDate = DateTime.Parse("10/03/2017"); | |
if (today.Month >= 7) | |
{ | |
Console.WriteLine(effectiveDate >= today && effectiveDate <= DateTime.Parse("30/06/" + today.AddYears(1).Year)); | |
} | |
else |
This file contains 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
SELECT distinct | |
Name, | |
[ItemId] | |
,[FieldId] | |
,len([Value]) | |
FROM [Sitecore_master].[dbo].[SharedFields] a Inner join | |
[Sitecore_master].[dbo].[Items] b on a.ItemId=b.ID | |
where value like '%<r xmlns:xsd="http://www.w3.org/2001/XMLSchema%'and b.Name like '%__Standard Values%' and len([Value])>251 |
This file contains 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 = Get-Database master; | |
$translationTemplate = $master.Templates["Path/To/Template/Needed/Translatable"]; | |
$calloutTemplate = $master.Templates["Path/To/Example/Callout"]; | |
#$translationTemplate; | |
$calloutTemplate += $translationTemplate; | |
$templateToExtend = Get-Item 'master:/templates/Path/To/Example/Callout' | |
$templateToAdd= Get-Item 'master:/templates/Path/To/Template/Needed/Translatable' |
This file contains 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 master:/content; | |
$sourceTemplate = Get-Item "Source-Template-Path-Or-Guid-Here"; | |
$targetTemplate = Get-Item "Target-Template-Path-Or-Guid-Here"; | |
Get-ChildItem $rootItem.FullPath -recurse | Where-Object { $_.TemplateName -eq $sourceTemplate.Name } | ForEach-Object { | |
$fieldValue = $_.MainImage; | |
$_.ChangeTemplate($targetTemplate); | |
$updatedItem = Get-Item $_.ID; | |
$updatedItem.PrimaryImage = $fieldValue; | |
} |
This file contains 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
##--Step 1 Create New Userdefined Template | |
$path = "master:\sitecore\content\loginbupacomau\Home\Cover"; | |
$item = Get-Item -Path $path | |
$itemTemplate = Get-Item -Path $path | Get-ItemTemplate -Recurse | |
$itemRendering = Get-Rendering -item $item | |
$itemLayout = Get-Layout -item $item | |
$itemReferences = Get-ItemReference -item $item | |
$itemReferrer = Get-ItemReferrer -item $item | |
$itemReferrer | |
$layout= Get-LayoutDevice * |
OlderNewer