Tridion Alchemy Plugin – Using latest release

Starting an Alchemy plugin project is super easy. In this post I just want to mention a quick tip that will help you use the latest version of the framework for your Alchemy potions.

1. Download the Alchemy4Tridion Developer Pack (VSIX Visual Studio Project template). This gives us some really cool filetypes in the File, New dialog:

Screen Shot 2015-09-29 at 17.36.35


2. After creating a new project, go to the Nuget Package manager and search for ‘A4T’ and install the framework. This makes sure your Alchemy DLL is the latest, and also gives you the goodness of the Visual Studio templates.
Screen Shot 2015-09-29 at 17.37.30


3. Get a good clean example to follow. As of September, 2015 this is the CopyInfo example from Alex Klock for me. The Big Box of Samples is intended to be the ‘Unit Testing’ plugin for the Alchemy devs, so lots of goodies to be found there too!


Have you built an Alchemy plugin that is a good starting point? Leave a comment below with a link to the source code. Thanks!

Read More

Alchemy 4 Tridion – Configure Upload to Webstore Popup in Visual Studio

Getting started with the Alchemy Framework for Tridion GUI Extensions is made easy with the great documentation provided on the online A4T API documentation site.

When first getting started you might use the HelloWorld sample project or the Big Box of Samples project.  Both are great places to start exploring the structure of an Alchemy plugin.

After the exploration you’ll want to make a small change, possibly some new text in the popup in the BBS project.  The popup text is in the View files at /Static/Views.

Then you’ll build the project and get an upload to alchemy webstore popup.   While this is great and we want to use this when our plugin is ready, we probably don’t intend to put our personal Hello World project in the Alchemy webstore.

Disable the Upload the Alchemy Webstore Popup

The Alchemy authors have thought of it all – including an easy way to configure this popup.
1.  Open the .csproj file for your project
2.  Update the following line.  I prefer to leave it to Release.  The HelloWorld plugin has it set to ‘true’.  I’m guessing that was the original implementation, but I very much like the Release|Debug mode switch.


Change to:


My Current Flow for Developing Plugins

(September, 2015)
1. Make a change in the VS project
2. Build
3. Open the Alchemy GUI
4. Uninstall existing plugin
5. Open windows explorer – drag and drop the .a4t file
6. Open gui and see change

Improved Flow

To help us all and also “celebrate the Anti-RSI gods”, Mark Williams has written a great blog post of how to automate the above steps, leaning on the PowerShell script from Jan Horsman. Get it setup to speed up your Alchemy Plugin hacking.


Writing Alchemy Plugins is fun and easy thanks to all the hard work Alex Klock and the team at Content Bloom have put into the Framework.  It’s quite addictive and has been described as a ‘lifestyle’ by Tanner Brine at this year’s Tridion Developer Summit Alchemy Presentation.  Good luck with your own alchemy concoctions!

Read More

Things I learned in Portugal

1. Pair-programming is as much about learning new keyboard shortcuts as it is supporting the one doing the typing. We avoided many environment and coding issues by being able to swap people or computers when the going got rough.

2. Code > Powerpoint
3. Drinks > Sleep

4. Alchemy is not only a framework, it’s a way of life. Think of a WordPress plugins-type system all baked into Tridion, and with Dev tools that integrate directly into Visual Studio. Yes. Yes! This is the coolest thing since sliced Razor Mediator code!

5.  Using the Tridion Content Porter for moving Pages and all dependencies is like asking a car salesman for a car that flies.  Also, Content Porter is not called Magic Porter or Page Porter.

6. After 2 days of hard work our there was more talk about work on our off day than work on our work day

7. There’s a common feeling within the group of a ‘wish list’ of requested features.

8. Where there’s a song there’s a way.

9. Bottle-fed sheep eat during the middle of the night. Peacocks are louder than roosters.

10. Never look at John Winter’s phone when he says he wants to show you a photo. Ever.

11. Shellfish and Seafood are the same word in Portugese, and in English Shellfish and Sea Insects is also the same word (well, kind of)

12. Gin and tonic drinks never go out of style and they do a great job of making them in Portugal. (Ice in the glass first!)

13. When the bell rings, run for the bus.

Read More

Tridion VBScript Mediator*

One of the many things I miss in Tridion 2013 SP1 is the ability to write VBScript code combined with Compound Templates.  Tridion was kind enough to provide the legacy pack for us ‘hardcore hackers’ who have our 10,000 line VBScript functions library perfected over the years in VBScript.  However, when we want to move to Compound Template programming, we’re left out in the cold with our VBScript skills and have to suffer with DWT, Razor, XSLT or C# coding.  Who wants to do that?  If we want to use the OOTB TBBs provided by Tridion to enable XPM or publish to FredHopper (for SmartTarget) the best way is to do this with a Compound Template.  But, Compound Templating and VBScript templates are not compatible – until now.

Using the VBScript Mediator we’ll have the best of both worlds – the fluency of the VBScript language and TOM API with the power of Compound Template modules.

First, if you don’t have it already, you’ll want to download the great VbsEdit program.  They have a really nice walkthrough on their homepage of all the features.

Next, you might want to download the VBScript Reference guide in case you’ve forgotten some of the commands in VBScript, such as setting an array to nothing.

Finally, go grab the code for the VBScript Mediator and start to have fun again with programming templates!

* This is an April Fools Joke!  VBScript in 2015….really?!

Read More

File, New Template

Going back in time, year 2000, Active Server Pages was all the rage, performing server-side magic and integrating with databases with ADO. Tridion had just released version 4.0 and adopted the MS Scripting Host, supporting VBScript and JScript as the de-facto standard scripting languages. We had DTD Schemas, XML, Blueprinting, and re-usable content. Content Delivery was 1 ISAPI filter to render the dynamic links. Life was good.

Today the landscape is very different and complex, with lots of the magic happening on the front-end Content Delivery tier, Context aware web applications serving mobile and desktop devices, running the latest SDL Content Delivery stack.

Today the standard supported template languages from the CMS is almost the same as it was in 2000 – we publish content – .aspx or .jsp files, from the CMS to the Content Delivery tier. We can still use the good old deprectated VBScript language, or the SDL-created DWT scripting tags, or the recent XSLT mediator, if XSLT is your thing. So, you want to stay within the ‘supported SDL technologies and products’ arena – this is it. Not cool.

But, look around and see what the SDL community has been up to, and hang on to your hat! It’s been a very busy last few years in the SDL community and today this is where all the cool kids hang out. .NET MVC – got it, with DD4T, created by Quirijn Slings – with great Forum support (185 questions answered) on StackExchange, classroom training from Trivident, and even a ‘Reference Implementation‘ built BY SDL on top of DD4T, called DXA (as of Feb 2015). Yes, the Reference Implementation is built on top of open-source SDL community software, by SDL, and yet DD4T is community software and not officially licensed or supported by SDL.

Maybe DD4T and a dynamic MVC runtime is not your thing. Your content or design is not changing too often, and your development team is happy with the static publishing model from years past.

If this is the case then the best option today is the Razor Mediator, created by Alexander Klock – again an open-source project, and again the most cool and often used technology on new SDL Tridion projects requiring static template programming, and again not officially supported by SDL. It also has good forum support (50 answers), great documentation with plenty of examples, and is widely used. With this mediator you might publish to a .NET Web Forms site or JSP files to a Web Application.

The good news is both of these solutions play well with the _really_ cool technology SDL has been creating and supporting in the Content Delivery tier. Yes, I’m referring to the pieces that make up SDL Mobile, including the Ambient Data Framework, Context Engine and Contextual Image Delivery. In addition, all of these open source frameworks also play well with other SDL supported software including SmartTarget, FredHopper, and Media Manager.

The community has grown by leaps and bounds in the past 15 years, and today this is where all the cool stuff is happening. It’s great to see so many active members in the community. If you have written your own framework, or built on top of the existing great frameworks out there, please share your solutions so we can together build the great frameworks of tomorrow.  If you’re thinking about using one of the frameworks above, go ahead and embrace these open source frameworks and be part of the community that created them.

These frameworks and solutions would not be where they are today without the time and support of developers at these organizations:  Trivident, Indivirtual, HintTech, Building Blocks, Cap Gemini, SDL and Yabolka.  Also, a big thanks to Nuno Linhares for his continued support of the SDL Community and organizing of the SDL Tridion MVP program.

Read More

Get List of Tridion Publish Targets with Core Service

Using the Core Service we can easily get a list of all the Publish Targets in the system. We might want to do this if we are creating an app to publish items to a target (like the publish window) or if we want to Decommission a Publication Target in an environment, such as when we restore a database from one environment to the next.

The following code will get a list of all PublishTargets available within the context of a Publication. If you want to get all targets in the system then using the Admin user is the best. However, if you want to use the logged on user, then see my previous article to use the Core Service as the authenticated user (for a web app).

The data returned from the GetSystemWideList call changed between 2011 and 2013, and with the code below you will get all the info from the 2013 method. Special thanks to Likhan for the tip on the Tridion StackExchange.

Read More

Using Core Service with Logged On User

The Tridion Core Service is a powerful API that gives us access to everything in the Tridion system. Sometimes we want to use an account with Admin permissions to get lists of items or delete items, for example. However, when creating or publishing items, we often want to do this in the context of the user logged into our Web Application built with the Core Service. This article is going to explain how to use the logged in user to perform Core Service actions and also give you a small debugging tip for Visual Studio.

Creating the Core Service Connection

I use a SessionAwareCoreService client which allows me to impersonate the user only with the username and not requiring a password. However, we do need port 2660 open between my local Visual Studio instance and the server if I debug against the server. Otherwise, if I work on my own local Virtual Machine with Tridion installed, I do not need to worry about this limitation. Then, after deploying to the server, it will work as expected.


Making it work in Visual Studio

This user is normally empty when debugging in Visual Studio and this caused a small issue for me. Luckily, I found this great StackOverflow post explaining the solution. The one that worked for me is this:

“look at the properties of the web project, hit F4 to get the project properties when you have the top level of the project selected. Do not right click on the project and select properties, this is something entirely different.

Change Anonymous Authentication to be Disabled and Windows Authentication to be Enabled.”

Happy Core Service hacking!

Read More

Tridion Event System Configuration Variables

The Tridion Event System is used to automatically perform actions for us when an event is ‘triggered’, such as saving a Component or Publishing a page. While programming our Event System solutions we sometimes need to specify the name of a Schema, WebDAV URL path of a Component, or (gasp) a Tridion URI. We don’t want this in our code and it’s better to have it in a config file. However, the Event System is a ‘Class’ project type, and we can’t simply put an app.config file in the folder and expect it to work. In this article I’ll show a small code sample that will allow you to read values from a config file.


This original code comes from the Mihai’s Google Code solution here:

However, in Mihai’s article the code is fairly complex and has lots of functionality I didn’t need, and instead I prefer a more simple approach for getting the config file and getting a key. So, I’ve give the code a haircut and present to you just the bits you need to store the config values outside the Event System.


1. Create a config file and add your appSettings:

2. Name the configuration file the same as the Event System DLL with ‘.config’ at the end. Put the config file in the same place as the DLL. This might be in the Debug folder on your Dev system or in the Bin folder on the Tridion server. For example, TridionEventSystem.dll.config


Use the GetAppSetting(keyName) method to get your app.config variables.


If in your Event System code you use static variables they will be “cached” and stay in Scope as long as the Event System is running. If you restart the TCM Service Host and TCM Publisher services then the static variables will be refreshed.

I also use the .Net ObjectCache in the code to cache the values and this would be helpful in case your variables are not static in the Event System class.

External Libraries

Finally, a small note, but the Tridion Event System likes to have 1 DLL, so if you reference any external libraries, or if you create many .Net projects with the solution (that produce their own DLLs) then you will need to put those DLLs in the GAC or use ILMerge to combine them. So, in that case, when possible, use 1 .Net project for the Event System and minimize the abstraction of the layers into their own .Net projects, as is often done with .Net solutions. For example, I created a ‘Model’ .Net project for the Models to share between the Event System and another project, but in the end this proved to be too much of a headache and instead I moved the Models into the Event System project.

Happy healthy hacking!

Read More

OrmLite SQL Server Example

ORMLite is a great example of a framework that does one thing and does it well. If we’re looking for a efficient and solid way to get and put data in a DB within .Net (or Mono) then the ServiceStack ORMLite micro-orm is a great choice. It was created by Demis Bellot. One of the great things about ServiceStack is the high level of support from Demis and you can find many of his answers on StackExchange. In this post I will explain how to quickly setup a connection to SQL Server and add / query 1 row. If you have used ORMLite before this article might not shed any new light into the ORMLite scenario for you. Note that the current version of OrmLite (v4) is paid software and uses a quota system for small projects and evaluations. The license allows a developer to use it for a DB of up to 10 tables for free.

Getting Started

1. Create a new .Net Console Application
2. Add a NuGet reference to OrmLite.SqlServer library

Prepare SQL Server

1. Create a new Database User (if needed) for your new DB.
2. Create a new Database (ORMLite does not do this for you)
3. Give the DB User permissions to the new DB
4. Create the connection string: “Server=Dev2011;Database=ItemInfoDb;User Id=MyNewDbUser;Password=S3cr3tPw;”

Write the code

The below code creates an instance of a POCO, and then saves it to the DB. Note the AutoIncrement data attribute. This creates our PK.

For more in-depth information I highly recommend the official ServiceStack documentation. and ORMLite example here.

Read More

Bookmarklet: Get Schema ID and Title

After my first entry to the Tridion Bookmarklet Challenge, to count items in the Dashboard, here is my second entry: View the Schema ID and Title for a selected Component. Drag the below box to your Bookmarks toolbar. Warning: The first time you use it the Schema Title will not load. However, from the 2nd time it will show. This has to do with the .load() argument and my lack of callbacks. It could probably be improved.

Frank Taylor implemented the same idea as an Alchemy Plugin:  What’s the Schema? It works from the Context Menu, so we can use it in more places than the Bookmarklet, and in his blog post he also explains how he made it.  Excellent!

View Schema Info

Big thanks to Peter Kjaer’s StackExchange answer about getting the $models object.

Read More