3

In Tridion 2011 SP1, I have a embedded multivalued field 'links'. This embedded field has a component link field 'internal_link'. The comp link has another embedded multivalued field 'sections'. This embedded field has 'category' as a field inside it.

Now to make 'category' site editable I have used the below markup.

@foreach(dynamic link in Fields.links){
    @foreach(dynamic sec in link.internal_link.sections){
        <tcdl:ComponentField name="Fields.links[@link.Index].internal_link.sections[@sec.Index].category">
...
</tcdl:ComponentField>

This markup produces the following source which is editable for comp links only and not the category field of the comp link. Please provide a direction-

<!-- Start Component Field: {"XPath" : "tcm:Content/custom:Content/custom:links[1]/internal-link[1]"} -->

UPDATE 1 - @Nuno, I was diverted to other site edit issue for last few days. Now I read
the approach of faking comp presentation. In the container HTML I see the
markup for Component Presentation, now where I can add a parameter
'IsDynamic'in this markup as suggested in your other post or we need to
change the CT to Dynamic from Embedded.

<!-- Start Component Presentation: {"ComponentID" : "tcm:33-5988", "ComponentModified" : "2013-08-21T22:10:15", "ComponentTemplateID" : "tcm:33-4482-32", "ComponentTemplateModified" : "2013-08-08T14:53:05", "IsRepositoryPublished" : true} -->
1

You need to add more information for Experience Manager/SiteEdit about the component you're trying to edit.

The problem here is that SiteEdit logic will only find fields of the "main" component in the component presentation and not of the linked components, so you need to create a "fake" component presentation in your markup so that SiteEdit understands the context (component) that those fields belong to.

I tried to explain this same concept on this answer.

  • I have used the razor helper function which has created the site-edit markup in the source as below for comp link fields but no luck. <!-- Start Component Field: {'XPath' : 'tcm:Content/custom:Content/custom:links[1]/internal-link[1]/image[1]'} --> – user725 Oct 1 '13 at 10:08
  • Does it generate markup for a component presentation? Or just for a field? If SiteEdit knows the name of the field, but not the component it comes from, it will not be able to let you edit it... – Nuno Linhares Oct 1 '13 at 10:10
  • No it is just for a field. I thought as the markup has custom:internal-link[1], then it should easily resemble the component to edit the field. May be I need to understand more on to implement the approach as suggested by you. Sorry the mark up it generates is - <!-- Start Component Field: {'XPath' : 'tcm:Content/custom:Content/custom:links[1]/custom:internal-link[1]/custom:image[1]'} --> – user725 Oct 1 '13 at 10:16
  • If you look at the siteEdit markup (that's what I tried to explain in the other answer I link to) there's 2 things identified: Component Presentation in the container html, and the field. If the container html points to one component, but then the field comes from another, Tridion will not understand that this comes from a linked component (way too debatable whether it should, let's leave that for another discussion). By faking the CP information you can achieve what you want. – Nuno Linhares Oct 1 '13 at 10:38

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.