Blog

Custom Document Types in Kentico CMS

Custom document types are probably the most powerful feature of Kentico, I’d like to talk about how we can build up complex document presentations from the easy-to-use content tree that allows non-technical users to manipulate the presentation of these documents.

Custom document types are probably the most powerful feature of Kentico, I'd like to talk about how we can build up complex document presentations from the easy-to-use content tree that allows non-technical users to manipulate the presentation of these documents.

Last year we developed an event site that required an agenda to be available for users to view and apply a filtering system. The specifications required there to be a page for each event as there was a lot of information to be recorded against each event.

The added complication was that there were multi-track sessions, so there were 5 individual sessions running in parallel as well as the possibility of these sessions each having demo slots!

Agenda main view

We created 2 custom document types:

Conference Day Document Type: this would be the container of the session document types.

Conference Session Document Type: this is the multi-functional document type that we used for each of the sessions you can see displayed on the agenda.

We created a few control fields to determine whether the session was a multi-track session, demo or a sponsor session. As part of most document types there were fields for text details, speaker details and so on. As you see in this screenshot of the form view, it's quite a straightforward interface.

Page creation form view

The next challenge was to structure these documents in such a way that would be easy for the content editor to easily manipulate where the sessions appeared. Using the content tree, we used the Conference Day Document Type at the initial 'container' for the sessions.

Content tree view

We could then add and arrange the documents using the drag-and-drop ability of the content tree, so that sessions could be dragged to be a child session of another session and so on. The final result was a tree of session documents which could then be interrogated using the TreeHelper API to render out to a control.

We ended up using a standard repeater on a custom user control, as it was easier to develop, test and debug. Using two-nested repeaters, we were able to render out the vertical time line, and when the 'itemdatabound' function reached the multi-track session, we could then render across that timeline space.

With the addition of tick-box options to determine product types and audience types, we were able to filter and blank out sessions that were not relevant.

The final result provides a very rich interface to the end user, but yet is very simple to administer.