How to enable inline editing of fields in SiteEdit when using XSLT TBB?

I am working on SDL Tridion 2011 SP1 with the XSLT Broker from SDL Tridion World and SiteEdit 2009 SP3. I created XSLT TBB and enabled Inline editing for the Template Template, included SiteEdit in the Page Template. I created a page using it and published it.

But SiteEdit is not activated for each field. When I looked at the page preview source, it has only one span tag for the entire component. But usually, if SiteEdit is enabled for a component, we should have a span tag for each field.

I am stuck at this point. I created XSLT TBB using the XSLT proxy.

Can anyone suggest if we can enable SiteEdit in a composite template using XSLT TBB? If this can be done, suggest me the steps to do this.

+2
source share
2 answers

If you use XSLT TBB with XSLT Mediator, you need to manually wrap the fields that you want to include for SiteEdit so that they appear in the output of your template. Consider wrapping fields with XSLT with code like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
        <xsl:for-each select="//*[local-name()='paragraph']">
            <div>
                <tcdl:ComponentField name="paragraph[{position() -1}].text" index="0">
                    <xsl:apply-templates select="./*[local-name()='text']"/>
                </tcdl:ComponentField>
            </div>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

This code goes through each paragraph field entered and displays the value of the text fields and wraps it with the appropriate SiteEdit TCDL syntax.

+4
source

It depends on the templates (XSLT, DWT, VBscript, or any other technology you use) to create an element around each field.

 <span>
     <!-- Start SiteEdit Component Field: { ... } -->
     This is the value of the field
 </span>

RenderComponentField DWT, <tcdl:ComponentField>. (a span ) " " TBB.

, HTML XSLT, , :

  • RenderComponentField OR
  • <tcdl:ComponentField
  • <!-- Start SiteEdit Component Field
+4

All Articles