Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While playing around with manually injecting XPM markup in rendered HTML I have noticed that it doesn't seem to matter what element precedes the HTML comments, as long as there is a container element that makes 'sense'. For example the following simple example enables a component presentation and heading, image and summary fields to be editable using <article>, <h1>, <div>, and <p> respectively:

    <!-- Start Component Presentation: {"ComponentID" : "tcm:4-82", "ComponentModified" : "2014-04-01T12:35:09", "ComponentTemplateID" : "tcm:4-83-32", "ComponentTemplateModified" : "tcm:4-83-32", "IsRepositoryPublished" : false} -->
    <h1><!-- Start Component Field: {"XPath":"tcm:Content/custom:Article/custom:headline"} -->Portugal</h1>
        <!-- Start Component Field: {"XPath":"tcm:Content/custom:Article/custom:image"} --><img property="image" src="/media/example.jpg">
    <p><!-- Start Component Field: {"XPath":"tcm:Content/custom:Article/custom:summary"} -->Portugal, officially the Portuguese Republic (Portuguese: República Portuguesa), is a unitary semi-presidential republic.</p>

Does anyone know if this is coincidence, or if this is a supported feature of Experience Manager? If so, it would have significant benefits - in a lot of cases we can use the natural containers provided by the HTML design, freeing us from the restriction of only using one tag (like the default <span/>) which tends to break the HTML design and result in different markup on Staging vs Live.

share|improve this question
As far as I know this is supported. I almost never use a <span>. The documentation suggests also that it's supported:… (But I agree that it could be stated more clearly) – Albert Romkes Apr 3 '14 at 8:03
Thanks for the doc link - I actually discovered this while playing around with your DD4T.XPM Nuget package examples - so thanks for that too! – Will Price Apr 3 '14 at 8:26
up vote 8 down vote accepted

XPM is intended to work with any tag, yes. The caveat is that it should be supported by the browser as a container element (and be valid in the context it is in). So basically, if you test it in the various browsers and the borders show up in the right place and you don't get any weird JavaScript errors, you're good to go.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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