DD4T: 'Losing Control' of the HTML

The introduction of DD4T (also known as Dynamic Delivery for Tridion) to the SDL Tridion world was a great day for developers and release managers. It provided a friendly developer experience, abstracted from Tridion, and also allowed for better release to production processes.

Now, when looking at new projects, instead of asking, "should we use DD4T?", we find ourselves asking "is there a reason why we shouldn't use DD4T?"  

Recently, one of those reasons reared its head.

“We want to be able to control the HTML, like we do now, from within Tridion using the Razor Mediator”

Digging a little deeper into the requirement, we discovered that the customer wanted to control the HTML of the Component Presentations from the Tridion interface,  to enable their marketing team to react to their customers and make quick changes, without having to involve IT. They didn't need to control the HTML at a page level. This meant that DD4T was still an option worth exploring, with an overlooked approach described below.

DD4T allows developers and intern editors to add both DD4T style Component Presentations, using the out of the box DD4T templates, as well as traditional statically rendered Component Presentations to the same page.

 It is very simple; to add a traditional, statically-rendered Component Presentation, follow the same basic steps as per a standard Tridion implementation 

  1. Create (or re-use) a Schema

  2. Create a Component Template:

    a. Use the “Page/Component Template metadata” Schema to target the Component Template in your DD4T Page Layout later.

    dd4t-1
    b. Mark the Component Template as “Publish Embedded on a Page”

dd4t-2

c. Write out HTML in the normal way with your preferred templating type

dd4t-3

  1. Link the Schema and Component Template

  2. Create content Components based on your Schema

  3. Update your DD4T Page Layout to output the static Component Presentation in the desired location(s), for example:
    @Html.RenderComponentPresentationsByView("ComponentTemplateName"
  1. Add a Component Presentation to your DD4T page(s), with the content and new static Component Template

  2. Publish your page

Now you will have the ability to manage (and quickly update) your HTML within the Tridion interface, while having the benefits of running a DD4T web application.

Any questions?

If you need more information or have any questions just get in touch and we'd be happy to answer them for you.