Dreamweaver Get eXtension (DGX)

This �Dreamweaver Function Source� compensates for the perceived limitations of the �out-of-the-box� Dreamweaver Mediator.


The launch of Tridion Modular Templates in 5.3 completely revolutionized the way we develop templates, and we have now more power than ever before. However, mostly for those of us that were used to writing VBScript templates, there were also some functionalities that were perceived as missing from the Dreamweaver Template �language�, namely:

  • Ability to format dates;
  • Reading data from items that are not �in the package�;
  • The ability to �follow� a component link chain, for instance, to retrieve the ALT tag for an image from its metadata fields.

Enter the DGX:

With this Dreamweaver Extension we expose functionality to the Dreamweaver mediator that was previously not possible. Using this extension you will be able to:

  1. Read from a component's parent folder;
  2. Read fields from a linked component;
  3. Read from a Page's parent Structure Group.

All this while using a standard �Dreamweaver Notation� for your fields � �Folder.Metadata.FieldName� or �Publication.Metadata.ComponentLink.Fields.FieldName�.

This extension exposes 3 methods:

  • Get(FieldPath)
  • GetFromItem(ItemID, FieldPath)
  • GetDate(FieldPath, DateFormat, CultureInfo)

Using this extension

The following are examples of how you can use this extension in your Dreamweaver templates:


<img src="@@Get("Fields.Image")@@" alt="@@Get("Fields.Image.Metadata.AltTagField")@@"/>

More complex use case: reading component linked field values while iterating through a multi-value component link field:

<div class="case_studies"><h2>@@Get("Fields.ListTitle")@@</h2
<!-- TemplateBeginRepeat name="Link" -->  
  <div class="section">  
    <div class="thumbnail_mask">  
        <img src="@@Get("Fields.Link[${TemplateRepeatIndex}].InternalLink.Fields.ThumbnailImage")@@"    
    <div class="sub_content">  
<!-- TemplateEndRepeat --> 


This method can be used in special cases, like trying to read data from a component within a Page Template. The following code will read a value from component presentations in a page.

    <!-- TemplateBeginRepeat name="Components" -->
        <!-- TemplateBeginIf cond="Components.Schema.Title='Promo'" -->
            <div>@@GetFromItem(Component.ID, "Fields.DisplayName")@@</div>
        <!-- TemplateEndIf -->
    <!-- TemplateEndRepeat -->


Pass the SiteCulture parameter as a string, or (String) Package Item. See here for a list of valid Cultures: http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx (use the �Culture Name� column).

<div>@@GetDate("Fields.Date", "MMM d, yyyy", SiteCulture)@@</div>

Special flags

The output of Get and GetFromItem can be tweaked by using special flags. A flag is turned "on" by pushing an item to the package with the following names:


By default, content is not HTML-encoded when retrieved using Get. By setting this flag, all content stored in TextFields, Item Titles, etc will be properly escaped (& becomes &amp; < becomes &lt;, etc)


If this flag is set, all (component field) output from Get will be wrapped with SiteEdit 1.3 style tags. This will enable inline-editing for SiteEdit 1.3 and you will not need to use the default SiteEdit building block in your component templates.


If this flag is set all (component field) output from Get will be wrapped with -tcdl:ComponentField- tags. This will enable inline editing for SiteEdit 2009 and you will have to add the SiteEdit 2009 �Enable Inline Editing� TBB to your Component Templates in order to enable field editing.

Differences from default DW Behavior

There are some use cases where the difference between this extension and the standard Dreamweaver mediator are obvious, like reading data from a component not currently in the package, or Folder metadata. Other use cases have more subtle differences:

  • Text fields are not escaped by default.
    If you have an ampersand in a text field, '&', the Dreamweaver mediator will escape it to &amp; - Get will not do this unless you use the �EscapeOutput� flag.
  • Multimedia Component Links in Rich Text Field
    1. If you link to a Multimedia component from a Rich Text field (not an image) the Dreamweaver Mediator will create a dynamic link to this binary and will not publish the binary itself. This means that you must manually or through some other means make sure the binary is published to the delivery server.
    2. If you use Get to read a Rich Text Field (@@Get("Fields.RichText")@@) this extension will ensure that:
    • The Multimedia file gets published
    • The link gets converted from a dynamic link to a "AddBinary"-style link

Installing this extension

To enable this extension you will need to: 

  1. Add the "Tridion.ContentManager.Templating.Extensions.dll" file to your Content Manager�s GAC (Global Assembly Cache)
  2. Register it with the Tridion Template Engine by adding it to the file [Tridion]\Config\Tridion.ContentManager.Config

Adding it to the Global Assembly Cache

You can add the assembly to the Assembly Cache by executing:

�C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\gacutil.exe� /i Tridion.ContentManager.Extensions.Templating.dll

(You can also open [Windows]\Assembly in Windows Explorer and drag-and-drop the file into this folder).

Registering the Extension with the Tridion Template Engine

Edit the file [Tridion]\Config\Tridion.ContentManager.Config.

Towards the end of this file you will find a section named �function Sources�. Add the highlighted line below to your configuration file:

  <functionSource type="Tridion.ContentManager.Templating.Expression.BuiltInFunctions"/>
  <functionSource type="Tridion.OutboundEmail.Templating.OutboundEmailFunctionSource"
                    assembly="Tridion.OutboundEmail.Templating, Version=,
                     Culture=neutral, PublicKeyToken=ddfc895746e5ee6b"/>
  <functionSource type="Tridion.ContentManager.Extensions.Templating.OutputHandler"
                    assembly="Tridion.ContentManager.Extensions.Templating, Version=2009.0.0.0,
                     Culture=neutral, PublicKeyToken=4e49325de7bb1958"/>

Make sure that this file is still well-formed after you edit it.

You will have to restart the Tridion Content Manager COM+ server, the Tridion Publisher and the Tridion Template Builder before you can use this extension.

This extension is created for version R5.3 but is valid, working and tested on SDL Tridion 2009 and 2011. 

:    Nuno Linhares
License agreement
:    Dreamweaver
:   1.0
:   Yes

About the Author
Nuno Linhares
Product Manager

Nuno Linhares was a Principal Consultant within SDL's Web Content Management Solutions Division (based in New York) and has worked with the company's Professional Services organization between March 2005 and September 2012. As from October 2012, Nuno became Product Manager for the SDL Tridion Product line. You can follow him on Twitter and his blog.

SDL CMT division