Skip to content

Instantly share code, notes, and snippets.

🤔
Thinking

Josh Hebb joshhebb

🤔
Thinking
Block or report user

Report or block joshhebb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joshhebb
joshhebb / SetPublishToChildrenDefault.config
Created Jul 16, 2019
Simple SDL Tridion / Web GUI extension to set an advanced publish setting by default.
View SetPublishToChildrenDefault.config
<?xml version="1.0"?>
<Configuration xmlns="http://www.sdltridion.com/2009/GUI/Configuration/Merge"
xmlns:cfg="http://www.sdltridion.com/2009/GUI/Configuration"
xmlns:ext="http://www.sdltridion.com/2009/GUI/extensions"
xmlns:cmenu="http://www.sdltridion.com/2009/GUI/extensions/ContextMenu">
<resources cache="true">
<cfg:filters />
<cfg:extensiongroups>
<cfg:extensiongroup name="SetPublishToChildrenDefault">
View Cleanup-RTF.xslt
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xhtml="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xhtml">
<xsl:output omit-xml-declaration="yes" method="xml" cdata-section-elements="script"></xsl:output>
<xsl:template match="/ | node() | @*">
<xsl:copy >
<xsl:apply-templates select="node() | @*"></xsl:apply-templates>
</xsl:copy>
</xsl:template>
@joshhebb
joshhebb / Read-AppData.ps1
Created Jul 16, 2019
Read and remove application data stored in a SDL Tridion Content Management database.
View Read-AppData.ps1
# Read the list of application IDs
Get-TcmApplicationIds
# Remove a specific piece of AppData by application ID (in this example, a Translation Manager configuration)
Remove-TcmApplicationData "tm:cache"
@joshhebb
joshhebb / AppDataExamples.cs
Last active Jul 14, 2019
A couple of helper functions to store and retrieve objects stored in Tridions application data. Useful for "caching" costly reports generated by the CoreService, but also just storing and retrieving C# objects in application data.
View AppDataExamples.cs
/// <summary>
/// Save an object in appData (stored in the CM DB) by serializing the object into a string,
/// then converting it to an array of bytes and storing it via the CoreService client.
/// </summary>
/// <param name="applicationId">The ID which the appData can be retrieved.</param>
/// <param name="data">The object to be stored in appData by applicationId.</param>
public void SaveAppData<T> (string applicationId, T data)
{
using (var client = new SessionAwareCoreServiceClient(""))
{
You can’t perform that action at this time.