First XSLT Function


This document is aimed at people who create very simple XSLT functions in C1 CMS, maybe even their first XSLT function! This could be a super user, or a very experienced editor with some technical background (lots of HTML experience).

Typically, it is a front-end developer just starting to work with C1 CMS or a developer who just starts with C1 CMS.

This document is written quite extensively to give this broad range of personas the full story on how to do this. The more experienced might even need to read very little text and just look at the screenshots.

We will create a function in C1 CMS allowing users to easily add external internet functionalities to their website with C1 CMS. In this case, we will be adding functionality to show YouTube and Vimeo videos embedded on a C1 CMS site. This means that these videos will play on your website. For an editor, it is just as simple as to add a function to the page and supply the video code, presto.

For you as the creator of the function, it is not even that much harder.

If you want to learn, read on; otherwise, just get the add-on.

Only little technical background required

To do this by yourselves, you will only need a little technical background; you don’t need to be a programmer:

  • You can read more complex HTML.
  • You have seen XSLT code before and managed to understand the very basics of XSLT.
  • Oh, and of course, you have access to C1 CMS and are allowed to create functions in there (which is just a matter of security in the manager).

Only want the functionality? Get the add-on

This functionality will also be available as a add-on; you do not have to do the manual labor of creating it by yourselves. If you simply want to get this on your site, drop the document and find the add-on on the package server.

Read to learn and create by yourselves

Good you’re still here! I will explain how to create the functions yourselves. I’m sure you can use this knowledge to create similar functions for other functionalities!

In this case, we will create an XSLT function. You can also create a function with similar functionality using .NET user control. In our case, XSLT is easier.

Since we will make an XSLT function, a little XSLT experience is required. But don’t fear if you don’t know much XSLT. You will only need the very basics to understand and change it.