8

I have a component template that I am trying to make editable in XPM. XPM is working correctly elsewhere on the website but for some reason I can't get it working with any fields in this CT.

The CT reads as follows:

 @@RenderComponentPresentationByTemplateName('@Component.Fields.Breadcrumb', 'Server Control Reference')@@
</div>

<div class="site-footer">
    <div class="container">
    <div class="row">
        <div class="col-lg-4 col-md-4 col-sm-4 footer-about">
            <img src="@Fields.Paragraph[0].Image" alt="alt-text"><br>
                <p>@RenderComponentField("Fields.Paragraph[0].Description", 0)</p>
        </div>

            @foreach(var item in Fields.Links)
            {
            <div class="col-lg-3 col-lg-offset-1 col-md-3 col-md-offset-1 col-sm-3 col-sm-offset-1 footer-links">
            <h3>item.Title</h3>
                <ul>
                @foreach(var c in item.Link)
                        {
                            <li><a tridion:href="@c.Component">@c.Text</a></li>
                        }                   
                </ul>
            </div>
            }   
    </div>
        <div class="row">
        <div class="col-lg-12 col-md-12 col-sm-12">
            <div class="footer-copyright">
            @RenderComponentField("Fields.CopyrightText", 0) | <a tridion:href="@Fields.CopyrightLink.Component">@RenderComponentField("Fields.CopyrightLink.Text", 0)</a>
        </div>
        </div>
        </div>
    </div>
</div>

I don't see anything immediately wrong with this.

8

The problem is caused by the closing tag at the start of the Razor template. Removing this tag fixed the issue.

It makes sense that this is breaks XPM as it either terminates the component area early or prevents the XPM editor from properly parsing the entire DOM for the component presentation.

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.