The permitted fields of the associated component for editing are available in SiteEdit 2009 SP2. The SiteEdit interface is based on the SiteEdit command language , which is embedded in the HTML that it returns from the staging server.
So, let's say you have one component:
<div class="cp"> <label>Title: </label> <span> Tips for getting insurance when you have a pre-existing condition </span> </div>
Those Start SiteEdit
comments contain the commands that your HTML gives to SiteEdit, and you can see how they mark the Component view and the header field.
If you create fields for a related component, you also need to have the corresponding Component Presentation command, for example:
<div class="cp"> <label>Title: </label> <span> Tips for getting insurance when you have a pre-existing condition </span> <br /> <div class="cp"> <label>Byline: </label> <span> "It a huge problem, because ..." says one expert. </span> <br /> <label>Copyright: </label> <span> Getty Images </span> </div> </div>
There are now two Start SiteEdit Component Presentation
commands, one for the external component and one for the associated component. It is important to note here that the IsQueryBased property of the nested component view must be set to true. This tells the SiteEdit interface that the component view should not be present on the XML page that it retrieves from Tridion.
In the front-end, SiteEdit doesn't matter how the commands fit in the HTML.
Most often, people call RenderComponentPresentation
and RenderComponentField
, which mark the relevant parts. But, unfortunately, the RenderComponentField
function can only be used to render fields from the so-called "context component", which looks like this:
Item component = _package.GetByType(ContentType.Component);
This means that in a single DWT, all RenderComponentField
calls will work in the same Component context. Therefore, you can never call a RenderComponentField
in one DWT to display fields from two different Components.
You have two options for solving this problem:
- Call
RenderComponentPresentation
for a related component - Run the
Start SiteEdit Component Presentation
and Start SiteEdit Component Field
yourself in DWT
Option 1 is the cleanest separation you can get: since you are visualizing fields from another component, you are essentially representing a different representation of the components. If you split the layout of related fields into a separate DWT and build a CT around this, you can do it the same way in your main DWT:
@@RenderComponentPresentation(Component.Fields.Name, "tcm:1-2-32")@@
Walter explained this best in his article on Tridion patterns :
Since the scope of this Dreamweaver template is limited to displaying the current fields of the component, an additional step is required using the RenderComponentPresentation function. We need to pass the TCM URI of the multimedia component of this function along with the TCM URI of another Dreamweaver template.
Although this leads to more CTs and DWTs, these DWTs will be much simpler because you can now use the RenderComponentField
in them as usual.
Option 2 really just means that you output HTML comments using the SiteEdit commands in your DWT. Since the command language is documented as part of the API (see Link above), there is little chance that it will change in future versions of SiteEdit 2009.
Sorry for the long story, you accidentally caused a difficult use case here. Hope this makes sense.