2

I am enabling SiteEdit 2009 for the Component in Dreamweaver TBB in SDL Tridion 2011 SP1.

Content XML:

<Content>
    <AAA>
        <BBB>
            <CCC>Title 1</CCC>
            <DDD>Name 1</DDD>
        </BBB>
        <BBB>
            <CCC>Title 2</CCC>
            <DDD>Name 2</DDD>
        </BBB>
    </AAA>

    <AAA>
        <BBB>
            <CCC>Title 1</CCC>
            <DDD>Name 1</DDD>
        </BBB>
        <BBB>
            <CCC>Title 2</CCC>
            <DDD>Name 2</DDD>
        </BBB>
    </AAA>

</Content>

The description of the Fields is:

  • AAA - Repeatable Embedded Schema
  • BBB - Repeatable Embeddable Schema within AAA

The Dreamweaver TBB is:

<!-- TemplateBeginRepeat name="AAA" -->

    <!-- TemplateBeginRepeat name="Field.BBB" -->
        <div>@@RenderComponentField(FieldPath+".CCC", 0)@@ </div>
        <div>@@RenderComponentField(FieldPath+".DDD", 0)@@ </div>
    <!-- TemplateEndRepeat -->

<!-- TemplateEndRepeat -->

I added this TBB in component template and previewed the Component. It showed the exact preview without the error.

The high level source of my Component Template looks like this:

<TemplateInvocation>Dreamweaver TBB</TemplateInvocation>
<TemplateInvocation>Enable Inline Editing</TemplateInvocation>

When I add "Enable Inline Editing" of SiteEdit 2009 to the Component Template it shows this error:

Debugging was started in process 'TcmTemplateDebugHost' with id 9244
Object reference not set to an instance of an object.
at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.FindItemFieldXPath(String[] parts, Int32 currentIndex, ItemFields fields, Boolean& isMultiValue)
at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.FindItemFieldXPath(String[] parts, Int32 currentIndex, ItemFields fields, Boolean& isMultiValue)
at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.FindItemFieldXPath(String[] parts, Int32 currentIndex, ItemFields fields, Boolean& isMultiValue)
at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.DetermineXPathForField(TcmUri componentUri, String fieldName, Boolean& isMultiValue)
at Tridion.ContentManager.Templating.Templates.EnableInlineEditing.ProcessComponentFieldTag(ITcdlTag tag)
at Tridion.ContentManager.Templating.TcdlParser.ProcessText(String text, TagHandler tagHandler, Boolean& wasModified)
at Tridion.ContentManager.Templating.TcdlParser.ProcessText(String text, TagHandler tagHandler)
at Tridion.ContentManager.Templating.TcdlParser.Process(Item item, TagHandler tagHandler)
at Tridion.ContentManager.Templating.Assembly.AssemblyMediator.Transform(Engine engine, Template template, Package package)
at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.RunTemplate(Engine engine, Package package, String templateUri, String className)
at Tridion.Templating.CSharpTemplate.CSharpSourceTemplate.Transform(Engine __engine, Package __package)
at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.Transform(Engine engine, Template template, Package package)
at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package)
at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
at Tridion.ContentManager.Templating.Compound.CompoundTemplateMediator.Transform(Engine engine, Template templateToTransform, Package package)
at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package)
at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
at Tridion.ContentManager.Templating.Engine.TransformPackage(Template template, Package package)
at Tridion.ContentManager.Templating.Debugging.DebuggingEngine.Run()
at Tridion.ContentManager.Templating.Debugging.DebugSession.Run()       

Can any one share their views on it?

Is it a limitation of SiteEdit 2009?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Patan
  • 17,073
  • 36
  • 124
  • 198
  • 2
    The resolution depends entirely upon the error you are getting. Unfortunately, you didn't actually show the full error so it's impossible to say what might be going wrong. Most likely, it is a problem with missing or incorrect parameters. Check the log in Template Builder or the Event Log for the exact details. – Peter Kjaer May 08 '12 at 09:21
  • Sorry. I missed that. Now I have updated the question with the log from Template Builder. – Patan May 08 '12 at 12:28
  • Did you install SiteEdit 2009 on the server that is running this code? In this case, that would be the server you are connecting to with the template builder. – Quirijn May 08 '12 at 13:31
  • @Quirijn: since his templates are running, it looks like those at least are installed. And as far as I know that is the only part that you need installed during publishing. The rest of SiteEdit doesn't get invoked until you access the published page through the SiteEdit proxy. – Frank van Puffelen May 08 '12 at 13:43
  • @Peter Kjaer. I have updated my question. – Patan May 09 '12 at 07:07

2 Answers2

2

It looks like you've already read this answer and tried to apply it: How to handle nested repeating regions in Dreamweaver TBBs in SDL Tridion 2011 SP1

In that case, did you also follow the debugging hint in that answer? And if so, what is the output you see?

Many people have problems writing constructs like these. I am no exception, I have just found that I can get most cases working by knowing that the crucial variables are: Field, FieldPath and TemplateRepeatIndex. When in doubt, simply embed this fragment into your DWT inside every TemplateBeginRepeat.

(FieldPath=@@FieldPath@@, TemplateRepeatIndex=@@TemplateRepeatIndex@@)
Community
  • 1
  • 1
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thank you for the answer. I see that My TBB works fine without Enabling Inline Editing in Component Template. But when included it it is throwing the error. – Patan May 09 '12 at 05:57
  • "Object reference not set to an instance of an object." was the main error. – Patan May 09 '12 at 07:01
  • This is the same error I am also facing when I am applying the XSLT TBB also – Patan May 09 '12 at 07:02
  • The answer I link to above gives very clear debugging instructions: include (FieldPath=@@FieldPath@@, TemplateRepeatIndex=@@TemplateRepeatIndex@@) in every loop in your DWT and update your question with the Output that generates. – Frank van Puffelen May 09 '12 at 13:25
  • Thanks a lot. When I tried debugging the TBB, I found the exact error. – Patan May 10 '12 at 09:00
  • That is great news. Would you mind sharing the problem you found, so that others may benefit from it? – Frank van Puffelen May 10 '12 at 11:16
  • The problem was the content in Component.I just changed the content. It worked. I am still figuring out the exact reason.Thanks a lot for your Inputs. – Patan May 10 '12 at 11:47
1

I would guess that there is something wrong with these lines:

@@RenderComponentField(FieldPath+".CCC", 0)@@

I'd try writing out the FieldPath+".CCC" concatenation to see you can actually get that value. I was under the impression that sort of thing wasn't possible to obtain a field value by concatenating two strings and that it's only possible on @@string_field_name${templateRepeatIndex}@@ (a field value concatenated with a repeating index) but its been a while since I've attempted it, so really see if you can first get the value to output

In the event you still can't resolve it, is it possible for you to supply the actual component XML and the actual DWT code? it's not easy to offer a solution based on the example code provided.

Thanks

johnwinter
  • 3,624
  • 15
  • 24