0

I want to add new component links using XPM view but I am not able to get that option. I am able to edit the fields of the component links. Here is my main component xml structure and DWT code.

<Content xmlns="uuid:e5063cee-b6c6-4005-9312-ce0a969f0c35">
    <title xmlns="uuid:e5063cee-b6c6-4005-9312-ce0a969f0c35">xpm new title</title>
    <complink xmlns="uuid:e5063cee-b6c6-4005-9312-ce0a969f0c35" xlink:type="simple" xlink:href="tcm:61-107006" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="XPMComponentLink"></complink>
    <complink xlink:type="simple" xlink:href="tcm:61-107006" xmlns:xlink="http://www.w3.org/1999/xlink"></complink>
</Content>

Here is the component link xml

<Content xmlns="uuid:e5063cee-b6c6-4005-9312-ce0a969f0c35">
    <childtitle>testtitle</childtitle>
    <childimage xlink:type="simple" xlink:href="tcm:61-85782" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:title="35311-GE-Retail-Lighting-101-eBook-284x95.jpg"></childimage>
</Content>

DWT Code

<div>
@@FieldStartMarker("Component.Fields.title")@@
@@FieldValueStartMarker()@@
<h3>@@Component.Fields.title@@</h3>
@@FieldValueEndMarker()@@
@@FieldEndMarker()@@
<!-- TemplateBeginRepeat name="Component.Fields.complink" -->
@@FieldStartMarker("Component.Fields.complink")@@
@@FieldValueStartMarker(TemplateRepeatIndex)@@
 @@RenderComponentPresentation(Field,GenerateCompLink)@@
@@FieldValueEndMarker()@@
@@FieldEndMarker()@@
<!-- TemplateEndRepeat -->
</div>

DWT code of GenerateCompLink

<div>
@@FieldStartMarker("Component.Fields.childtitle")@@
@@FieldValueStartMarker()@@
<h3>@@Component.Fields.childtitle@@</h3>
@@FieldValueEndMarker()@@
@@FieldEndMarker()@@
@@FieldStartMarker("Component.Fields.childimage")@@
@@FieldValueStartMarker()@@
 <img src="@@Component.Fields.childimage@@" tridion:type="Multimedia"/> 
@@FieldValueEndMarker()@@
@@FieldEndMarker()@@
</div>

Can somebody please suggest what I need to do so that I am able to add/delete the component links ?

  • I was finally able to make it work by tweaking my Html structure a bit. I have added the updated DWT code. – user3560198 May 12 '16 at 18:12
0

Here is the updated DWT code

Main DWT

<!-- TemplateBeginRepeat name="Component.Fields.complink" -->
@@FieldStartMarker("Component.Fields.complink")@@
@@FieldValueStartMarker(TemplateRepeatIndex)@@
<div>
 @@RenderComponentPresentation(Field,GenerateCompLink)@@
</div>
@@FieldValueEndMarker()@@
@@FieldEndMarker()@@
<!-- TemplateEndRepeat -->

GenerateCompLink DWT

@@FieldStartMarker("Component.Fields.childtitle")@@
@@FieldValueStartMarker()@@
@@Component.Fields.childtitle@@
@@FieldValueEndMarker()@@
@@FieldEndMarker()@@
@@FieldStartMarker("Component.Fields.childimage")@@
@@FieldValueStartMarker()@@
<img src="@@Component.Fields.childimage@@" tridion:type="Multimedia"/>
@@FieldValueEndMarker()@@
@@FieldEndMarker()@@

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.