Documentation Center

Making a linked Component editable

To make the fields of a linked Component embedded inside another Component editable, render the inner Component and surround it with a Start Component Presentation command in which both IsQueryBased and IsRepositoryPublished are set to true.

Procedure

  1. In your Dreamweaver Template Building Block (or whichever Template Building Block renders your output), ensure that your linked Component is rendered properly.

    The simplest way to ensure this is by calling RenderComponentPresentation as follows:

    @@RenderComponentPresentation("LINKEDCOMPURI", "LINKINGCOMPTEMPLURI")

    where LINKEDCOMPURI is the Content Manager URI of the linked Component (target of the link), and LINKINGCOMPTEMPLURI is the Content Manager URI of the Component Template used by the linking Component (source of the link).

  2. Alternatively, for more fine-grained control, render the Start Component Presentation and its Start Component Field commands by hand.
  3. Whichever method you choose, you must ensure that the resulting inner Component Presentation has a Start Component Presentation tag.

    The following is an example of what your HTML output for the staging server should look like. The outer <div> represents the outer Component Presentation with the Component Link field, and the inner <div> is the linked (inner) Component Presentation.

    <div class="cp">
    	<!-- Start Component Presentation: {
    		"ID" : "cp_1",
    		"ComponentID" : "tcm:12-459",
    		"ComponentTemplateID" : "tcm:-12-568-32",
    	"ComponentVersion" : 5 } -->
    
    	<label>Title: </label>
    
    	<span>
    		<!-- Start Component Field: { 
    			"ID" : "cf_1",
    			"XPath" : "tcm:Content/custom:Content/custom:Title",
    			"IsMultiValued" : false } -->
    
    	This is the outer Title field
    
    	</span>
    
    	<br / >
    
    	<div class="cp">
    		<!-- Start Component Presentation: { 
    			"ID" : "cp_2",
    			"ComponentID" : "tcm:12-85",
    			"ComponentTemplateID" : "tcm:-12-60-32",
    			"ComponentVersion" : 2 
    			"IsRepositoryPublished" : true,
    			"IsQueryBased" : true } -->
    
    		<label>Byline: </label>
    
    		<span>
    			<!-- Start Component Field: { 
    				"ID" : "cf_2",
    				"XPath" : "tcm:Metadata/custom:Metadata/custom:ByLine",
    				"IsMultiValued" : false } -->
    
    			This is the byline field of the inner Component
    
    		</span>
    
    		<br / >
    
    		<span>
    			<!-- Start Component Field: { 
    				"ID" : "cf_3",
    				"XPath" : "tcm:Metadata/custom:Metadata/custom:Copyright",
    				"IsMultiValued" : false } -->
        
    			This is the copyright field of the inner Component
    
    		</span>
    
    	</div>
    
    </div>