1

I am trying to edit multiple Component link fields but they are not editable.

I can open the Component in form view. I am using DWT Templating. My DWT Templating source code can be seen here: https://pastebin.com/hAMV0icv, the HTML source generated of that here: https://pastebin.com/4GeaiPrb. Also attaching a screenshort for further reference

enter image description here

  • Can you edit your question and add the HTML outcome of the DWT template, XPM works using HTML comments indicating the editable fields, and that might be where your problem is. – Bart Koopman Apr 25 '18 at 7:15
  • DWT HTML output attached with this link. pastebin.com/4GeaiPrb – Thoufik Ahamed Apr 25 '18 at 7:43
1

Looking at the HTML output, I think you took it directly from the CMS, since it still contains tcdl:ComponentPresentation tags, which would not be there on the actual web site (I assume). But this does already show a part of your problem, which is that you have conflicting data.

When you look right under the body tag you see:

<div class="col-lg-9 fRight mB20 inner">
  <tcdl:ComponentPresentation type="Embedded" componentURI="tcm:18-7078" templateURI="tcm:18-4925-32">
  <span>
    <!-- Start Component Presentation: {"ComponentID" : "tcm:18-7078", "ComponentModified" : "2018-04-25T11:29:45", "ComponentTemplateID" : "tcm:18-4925-32", "ComponentTemplateModified" : "2018-04-08T11:22:20", "IsRepositoryPublished" : false } -->
    <tcdl:ComponentPresentation type="Embedded" componentURI="tcm:18-317" templateURI="tcm:18-3629-32">

Two tcdl:ComponentPresentation tags, but only the first one has an XPM markup (<!-- Start Component Presentation: {...} -->).

The parent HTML element of the mentioned XPM markup is the <span> tag which follows the first tcdl:ComponentPresentation tag, and only the fields which are inside this, will be editable (provided they are actually fields of the mentioned Component).

Since the HTML is rather large I didn't bother to completely check it manually, but I suggest you either properly indent it and check if it is well formed, or run it through a tool to check the well formedness of it. If the HTML is not well formed (i.e. it misses closing tags etc.) XPM might fail in delivering editable fields.

Besides that, the other problem I see is the fact that it seems there are two Component Presentations which appear to be nested. Now you can nest <!-- Start Component Presentation: {...} --> markup in XPM, but you have to make sure it is all nested properly and logically. Take for example the following pseudo HTML:

<div>
    <!-- Start Component Presentation: {..cp1..} -->
    <span>
        <!-- Start Component Field: {..cp1-f1..} -->
        field value
    </span>
    <div>
        <!-- Start Component Presentation: {..cp2..} -->
        <span>
            <!-- Start Component Field: {..cp2-f1..} -->
            field value
        </span>
    </div>
</div>

Now the use of the <div> and <span> tags is important, it can be any HTML element (please ensure correct usage/nesting of block level and inline elements), but there has to be something around the XPM markup and the fields of a Component Presentation need to be inside the element which surrounds the CP.

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.