Want to have a DD4T Application running within 1 hour? Not possible? Today I did that at the first Tridion DD4T training taught by Quirijn Slings and hosted at the Trivident office in Amsterdam. In this course we start at the very beginning and throughout 2 days go very deep inside DD4T and learn not only how to do many things, but why they were created that way in the first place!
The atmosphere of the course is similar to other SDL Tridion courses I have attended or taught, informal and focussed on the participant. Quirijn was kind enough to entertain all of our questions and comments, providing real-time coding examples or on several occassions diving deep into the DD4T Source code to show us how it was built and why it behaves in a certain way. This is priceless and the information is not found anyplace else.
On the first morning Quirijn gave us an overview of the DD4T concepts and why the framework was created. Shortly after this he led to us create a DD4T project from scratch, and it felt effortless. I’ve spent a lot of time previously creating DD4T projects from scratch, and nothing compares to how easy it was in the class. Small tips from Quirijn saved us many hours if we were to do this alone.
Later in the day we created Page views and Component views and the exercises were very easy to get into and the environment supported us very well. The exercise content of the course is really nice, with animals imported from a BBC website, making it feel like a nice training environment. Our new views looked great on the screen with the nice content. We used Visual Studio 2013 and MVC 5 to create our solutions.
Day 2 was more in depth than day 1 and we looked into the link level logic and were given some best practices and real-life examples of when to use what link level and the implications of it. We also went over publishing sitemaps, resource files (resx), and also hints about what is coming up in DD4T 2.0. We had a long discussion on caching with DD4T and the different approaches to be used for caching. Finally we learned how easy it is to make Preview work in DD4T (it really is easy) and see this article from Quirijn on the Trivident blog. He also showed us how to read a configuration file from a Compound Template and wrote another nice post here.
We were also given many tips that will save us hours of time during real projects. Below I will outline some of the tips he shared, but for the full experience I highly recommend to attend this training.
Minimize XML in DD4T
– Removes Publication, Folders (saves 30%)
– JSON publishing coming in DD4T 2.0, using compressed JSON
Template Builder Popup- to select Folder or Structure Group
– Using Template Builder, when creating Template Metadata fields, starting the XML fieldname with ‘sg_’ or ‘folder_’ allows us to select the items from the Template Builder!
RenderedContent in DD4T
– RenderedContent property contains the output if it is not DD4T XMl. The DD4T TBB examines the output of the Component Presentation, if not DD4T XML, puts in RenderedContent
Resources
– Resx is published to DB
– In web.config, tell it to use the DD4T Resources provider
– Resource page path defined in the web.config
– Need to create our own TBB to publish the resx file. Reason is that DD4T does not want to imply the structure of the Key/Value Schema you need to use in Tridion. There are many different aproaches to store key/value fields.
Index Pages with DD4T
Index pages with DD4T using custom controller and action method. This allows us to easily query the Broker directly or another external system and the Component on the page is a ‘placeholder’ that says directs the Page to output the results of the Query where the Author places it.
– On the CT Metadata, add 2 fields for the name of controller and name of action. XML Names are:
– controller
– action
Summary
This training will help those without DD4T knowledge get up and running very quickly. It also will provide information and tips for seasoned DD4T experts including in-depth caching explanations, using Broker queries with DD4T, link-level philosophy, and ideas where DD4T will improve in the future. Finally, SDL is showing increased support of the DD4T framework, with the inclusion of it in the Tridion Reference Implementation, using it on SDL.com, and also recommending it for current and future customers. It’s here to stay and now we have a great place to learn more about it in person.