Your question is a little confusing, but it seems like you have 2 issues
- You have an extra
<tcdl:ComponentField/>
tag which you don't want - You get an error when you use
TemplateRepeatIndex
If that is not correct, please consider modifying your question.
For issue number #1- can I assume you are seeing the <tcdl:ComponentField/>
in Template Builder? Or are you seeing this in the final published page? This tag is added to the output by the @@RenderComponentField@@
function to allow you to add SiteEdit of TridionUI markup to your output. If should not end up in your published pages if you apply the 'Default Finish Actions' TBB at the end of your template. The default templates contain code to clean up this tags after any SiteEdit/UI markup is applied.
For your second issue, take a look at these post 'How to handle nested repeating regions in Dreamweaver TBBs in SDL Tridion 2011 SP1' and 'http://www.tridiondeveloper.com/get-and-set-variables-in-dwts'.
Nested/embeded fields can be confusing using the default Tridion syntax for Dreamweaver, so you might consider using the great GetExtension from Nuno Linhares. This will make your life much easier