Crownpeak (Retired)

Template Development: Hello World



First, let’s see how to do this using visual studio.

Make sure you have the Crownpeak Desktop Connection installed and that you have the plug-in configured to connect to your CMS instance. I’m using the TrainingAndDemos instance for the purposes of this demonstration.

  1. Navigate to the "Templates" folder in the CDC File Explorer panel. You could be using the local Templates folder of a "Sites and Projects" implementation.
  2. Right-click on the folder and select New > Template C#. You will be prompted for the new template name - we will use "HelloWorld" in this case. Once that is done, you will see a new folder in the tree view.
  3. Opening the new folder will show you two template files input.aspx and output.aspx . These are the default template files the CMS creates for you.
  4. Double click output.aspx to open the file in Visual Studio. You will see a couple of lines of boilerplate template code that handles imports and the like at the top of the file.
  5. Edit the code and replace the sample code with our Hello World HTML.
  6. Once you have done this, save the file.

The next thing we need to do is create an asset that uses the new template.

It is best to use the CMS interface for the next few steps.

In this example, we're using the Crownpeak V3 interface.

  1. Navigate to the content folder of your project.
  2. Select New > File . The CMS should now be showing the "Create New File" dialog.
  3. Provide a name for the asset, "Article One" for example.
  4. Pick the template to use for the asset. In this case, pick the "Hello World" template we made previously.
  5. Pick the workflow to use, "Basic Workflow" in our example, is the workflow provided in all CMS instances.
  6. Finally, click Create to complete the process. In the "File View", double click the newly created asset to show the output view and we should see our "Hello World" message.
Labels (1)

Can't find what you are looking for?

Find Answers

Search our DXM Forum to find answers to questions asked by other DXM users.

Ask a Question

No luck? Ask a question. Our Product and Support teams are monitoring the Forum and typically respond within 48 hours.

Ask a Question