I have a problem with the Dynamic Linking functionality.
I have a Component Template which renders the rest of the Components of the Page, so when I try to find a Component of this Page in the LINK_INFO
table I don't see it because it has been rendered from the Component Template, not the Page Template, I think.
I mean, I have a Page with a Component Template which execute the RenderComponentPresentation
method of the rest of the Component Presentations in the Page, like that:
<!-- TemplateBeginRepeat name="AuxiliarComponents" -->
@@RenderComponentPresentation(Component.ID, ComponentTemplate.ID)@@
<!-- TemplateEndRepeat -->
I have tried this pieces of code too:
<!-- TemplateBeginRepeat name="AuxiliarComponents" -->
@@RenderComponentPresentation()@@
<!-- TemplateEndRepeat -->
<!-- TemplateBeginRepeat name="AuxiliarComponents" -->
${RenderComponentPresentation()}
<!-- TemplateEndRepeat -->
This codes renders and publish the content of the AuxiliarComponents well, but they are not in the LINK_INFO
table, so I can't use dynamic linking functionality.
Is it possible to include it in this table rendering from the Component Template? Is there any option to include it in this table through Component or Page Template?
All the Component are in the Page added like normal Component Presentations, but the most of them are rendered by some Component Templates. Is there any way to do that from this Component Templates? Is there another problem?
Is it possible to execute in the Component Template something like that to solve it?
<tcdl:ComponentPresentation type="Embebbed" pageURI="tcm:786-228287-64" componentURI="tcm:786-228076" templateURI="tcm:786-227832-32" xmlns:tcdl="http://www.tridion.com/ContentDelivery/5.3/TCDL" />
If the problem is the render context, I have added this code in a TBB, called from CT before render the Component Presentations, to add the Page to the package:
if (engine.PublishingContext.RenderContext.ContextItem != null)
{
Item pageItem = package.CreateTridionItem(ContentType.Page, engine.PublishingContext.RenderContext.ContextItem.Id);
package.PushItem("Page", pageItem);
sesion.ContextData.Add("Page", pageItem);
engine.PublishingContext.RenderContext.ContextVariables.Add("Page", pageItem);
}
With this code I can get the TCM URI of the Page in my DWT code with this:
<h1>@@Page.ID@@</h1>
Thanks in advance.