I'm getting started with tridion and i'm working on an "old" tridion project. With the template builder, i managed to see how the component models are built but i need to debug my C# code which is inside a block of construction of model (not sure about the translation in english, sorry).
How can i see when i debug with the template builder what a variable contains? Thanks in advance for your help.
For example, in the following code , i want for instance to see what "publicationTitle" contains:
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="Tridion.ContentManager.ContentManagement.Fields" %>
log.Debug("Begin: GroupDocumentItems");
string publicationTitle = string.IsNullOrEmpty(package.GetValue("Page.Publication.Title")) ? package.GetValue("Component.Publication.Title") : package.GetValue("Page.Publication.Title");
package.PushItem("Output", package.CreateStringItem(ContentType.Text,publicationTitle);
Component comp = engine.GetSession().GetObject(package.GetValue("Component.ID")) as Component;
ItemFields fields = new ItemFields(comp.Content, comp.Schema);
TextField field = fields["pathFolder"] as TextField;
string location = field.Value;
List<TcmUri> list = new List<TcmUri>();
Filter componentFilter = new Filter();
componentFilter.Conditions.Add("Recursive", true);
componentFilter.Conditions.Add("ItemType", ItemType.Component);
OrganizationalItem oi = engine.GetSession().GetObject("/webdav/" + publicationTitle + location) as OrganizationalItem;
foreach (Component siblingComponent in oi.GetItems(componentFilter))
{
if (siblingComponent.Schema.Title == "SC_document")
{
list.Add (new TcmUri(siblingComponent.Id));
}
}
StringBuilder sb = new StringBuilder();
sb.Append("<root>");
sb.Append("<items>");
foreach (TcmUri tu in list)
{
sb.Append("$(tfde:" + tu.ToString() + ";Document Item XML)");
}
sb.Append("</items>");
sb.Append("</root>");
package.PushItem("Output", package.CreateStringItem(ContentType.Text, sb.ToString()));
log.Debug("End: GroupDocumentItems");
And if possible, i would like to see it in the output tab in the template builder when i debug my component model under a specific component.