Is it possible to call the SiteEdit editable content script to output the content from TBB using RenderComponentPresentation method?

Currently, I am getting a red border line wrapped that content. When I roll over the top right corner icon, it is saying removed. However, the component content is not removed, any changes of the component template or page all have been republished and component itself is also not dynamic component.

The SiteEdit is working if I am calling the editable script directly from TBB, but if I am using RenderComponentPresentation method to call another Component Template to output that script. I only get the red border line and saying it has been removed.

Editable script: (working directly from TBB)

<!-- TemplateBeginIf cond="Content != ''" -->
<tcdl:ComponentField name="Content">${Content}</tcdl:ComponentField>
<!-- TemplateEndIf -->

Within TBB calling below method and always getting a red border RenderComponentPresentation(ComponentID, ComponentTemplateID)

Environment: Tridion 2011, SiteEdit 2009 SP3, Windows Server 2008

2

There are 2 answers

0
Peter Kjaer On

If you are rendering a Component which is not on the current Page, then it is to be expected that SiteEdit considers it removed.

You will need to mark the Component Presentation as "query based" so SiteEdit knows not to expect it on the Page. This will disable the functionality which doesn't make sense (such as drag-and-drop to move the CP around on the Page) but will otherwise work the same.

To mark it as query-based, you will need to manually output the markup (see Start SiteEdit Component Presentation command) or use some other tool to do it for you, like the functions created by Frank van Puffelen (note: I believe these only work for the 2011 version). Make sure the IsQueryBased parameter is set to true.

1
Ram G On

I guess this is not feasible with RenderComponentPresentation since what you're trying to do is nested component presentations. However you can get this by adding the siteedit markup tags directly with IsQueryBased to true

Please check the link for additional info (bottom of the section): http://sdllivecontent.sdl.com/LiveContent/content/en-US/SiteEdit_2009_SP3/concept_0D0C929C17D74A6292B2AFE0C29F4DCD

Alternative approach is to add the below markup before your nested component presentation (IsQueryBased should be true):

<!-- Start SiteEdit Component Presentation: {
  "ID" : "MyCP23", "ComponentID" : "tcm:54-7894",
  "ComponentTemplateID" : "tcm:54-3201-32",
  "ComponentVersion" : 2,
  "IsQueryBased" : true,
  "SwapLabel" : "Left"
} -->