Skip to content

Instantly share code, notes, and snippets.

View PraveenMathew92's full-sized avatar
🇮🇳

Praveen Alex Mathew PraveenMathew92

🇮🇳
View GitHub Profile
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CategoryCacheTest.ascx.cs" Inherits="RockWeb.Blocks.Core.CategoryCacheTest" %>
<asp:UpdatePanel ID="upPanel" runat="server">
<ContentTemplate>
<asp:Label runat="server" Text="Defined Value:"/>
<br />
<asp:Label ID="lbDefinedValue" runat="server" />
<br /><br /><br />
<asp:Label runat="server" Text="Defined Value Category Name:"/>
<br />
// <copyright>
// Copyright by the Spark Development Network
//
// Licensed under the Rock Community License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.rockrms.com/license
//
// Unless required by applicable law or agreed to in writing, software
{% definedvalue where:'DefinedTypeId == 111' %}
{% for definedvalue in definedvalueItems %}
{{ definedvalue.Id }}
{{ definedvalue.Value }}
{{ definedvalue.CategoryId }}
{{ definedvalue.CategoryName }}
<br />
{% endfor %}
{% enddefinedvalue %}
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.web>
<authentication>
<forms defaultUrl="/" xdt:Transform="SetAttributes(defaultUrl)" xdt:Locator="Condition(@defaultUrl='Page/12')"/>
</authentication>
</system.web>
</configuration>
// <copyright>
// Copyright by the Spark Development Network
//
// Licensed under the Rock Community License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.rockrms.com/license
//
// Unless required by applicable law or agreed to in writing, software
/// <summary>
/// PA: Add BlockAttributeKeysToIgnore Attribute to PostUpdateDataMigrationsReplaceWebFormsBlocksWithObsidianBlocks Job.
/// Also populate the existing jobs with the Block Attributes to be ignored so that they do not fail.
/// </summary>
private void AddBlockAttributeKeysToIgnoreAttributeToPostUpdateDataMigrationsReplaceWebFormsBlocksWithObsidianBlocksJob()
{
// Update the Block Attribute Key of the old webforms Login Legacy block to match the corresponding one in the new Obsidian version.
Sql( "UPDATE [ATTRIBUTE] SET [KEY] = 'HideNewAccountOption' WHERE [GUID] = '7D47046D-5D66-45BB-ACFA-7460DE112FC2'" );
// Update the Block Attribute Keys of the old webforms Group Registration block to match the corresponding ones in the new Obsidian version.
/// <summary>
/// PA: Add Terms and Privacy Page Along with Page Routes
/// </summary>
private void AddTermsAndPrivacyPageUp()
{
// Add Page Terms to Site:Rock RMS
RockMigrationHelper.AddPage( true, SystemGuid.Page.SUPPORT_PAGES_EXTERNAL_SITE, SystemGuid.Layout.FULL_WIDTH, "Terms", "", "DF471E9C-EEFC-4493-B6C0-C8D94BC248EB" );
// Add Block Terms of Use to Page: Terms, Site: External Site
RockMigrationHelper.AddBlock( true, "DF471E9C-EEFC-4493-B6C0-C8D94BC248EB".AsGuid(), null, "F3F82256-2D66-432B-9D67-3552CD2F4C2B".AsGuid(), Rock.SystemGuid.BlockType.HTML_CONTENT.AsGuid(), "Terms of Use", "Main", @"", @"", 0, "A29ACEF4-BB4B-498B-85EE-8543C8E0E7FC" );
@PraveenMathew92
PraveenMathew92 / Migration.cs
Last active March 15, 2024 17:03
Updated Registration Template Confirmation Email
/// <summary>
/// PA - Updated Registration Template Confirmation Email to not include Additional Confirmation Details if all registrants are in wait list
/// </summary>
public override void Up()
{
// Replace the old Templates to include check for waitlist while getting the count of registrants.
Sql( @"UPDATE [RegistrationTemplate]
SET [ConfirmationEmailTemplate] = REPLACE([ConfirmationEmailTemplate],
'{% assign registrantCount = Registration.Registrants | Size %}',
'{% assign registrantCount = Registration.Registrants | Where:''OnWaitList'', false | Size %}')" );
public class SortCMSPages : Migration
{
/// <summary>
/// Operations to be performed during the upgrade process.
/// </summary>
public override void Up()
{
// Remove page display options for Section Pages in CMS Config
var cmsSectionPageGuids = new string[] {
"\'CCDFEA8F-CF33-49C7-86C0-C4B10DCF1E89\'", // Website Configurations Section Page
// Add Page
// Internal Name: Migration Job Test
// Site: Rock RMS
RockMigrationHelper.AddPage( true, "7F1F4130-CB98-473B-9DE1-7A886D2283ED","D65F783D-87A9-4CC9-8110-E83466A0EADB","Migration Job Test","","18EE0F64-57D5-43BE-B3B4-DA3A77EC28D6","");
// Add/Update Obsidian Block Entity Type
// EntityType:Rock.Blocks.CMS.PageShortLinkDetail
RockMigrationHelper.UpdateEntityType("Rock.Blocks.CMS.PageShortLinkDetail", "Page Short Link Detail", "Rock.Blocks.CMS.PageShortLinkDetail, Rock.Blocks, Version=1.16.0.5, Culture=neutral, PublicKeyToken=null", false, false, "AD614123-C7CA-40EE-B5D5-64D0D1C91378");