1

I coustomized DXA(Tridion Reference Implementation) to get componentlink field value by following page. Issue with GetCompLink in the Tridion Reference Implementation

Now I create a schema which has a component link field, and component linked from it also has a component link field. In this situation, values of 2nd linked component are not mapped to model.

My schema definition is following.

  • "TestSample" schema has a componentlink field "linkToComponent", which links to "TestSampleLink1st" component
  • "TestSampleLink1st" shcema has a componentlink field "linkComponent", which is links to "GeneralHeading" component
  • "GeneralHeading" schema has some fields

As a result of debug, DD4TModelBuilder.GetCompLinks method is called for 2nd linked component("GeneralHeading"), but the component's "Fields" property doen't have any value.

Does DXA support componentlink in componentlink?

My model classes are following.

public class TestSample : EntityBase
{
    public string Heading { get; set; }
    public TestEmb TestStr { get; set; }
    public double TestNum { get; set; }
    public List<string> MultiStr { get; set; }
    public TestSampleLink1st LinkToComponent { get; set; }

    public TestSample()
    {
        MultiStr = new List<string>();
    }
}

public class TestSampleLink1st : EntityBase
{
    public string Heading { get; set; }
    public GeneralHeading LinkComponent { get; set; }

}

public class GeneralHeading : EntityBase
{
    public string Heading { get; set; }
    public string FontSize { get; set; }
    public string Anchor { get; set; }
    public string CharacterColor { get; set; }
}

Regards,

2
  • 1
    Can you check if the fields of the 2nd linked component are published in the dd4t xml ? maybe it's a just matter of adjusting the link levels (you can adjust it in the "Render Component Content" TBB in folder modules/core/Developer/Core Template Building blocks. By default, the link level is set to 2. Try setting it to 3 or 4 May 13 '15 at 11:22
  • 1
    On "Source" tab of "Render Component Content" TBB, there is "LinkLevels" element. I increased its value to 3, then 2nd linked component value is retrieved. May 14 '15 at 1:19

Your Answer

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

Browse other questions tagged or ask your own question.