I have a DCP with Allow on Page Using Dynamic Assembly checked which I am storing in the database. This DCP is a summary display of a component, and it contains a component link to another component presentation using the same component on a different page. I have the Output Format set to REL
so that the dynamic link will be resolved at runtime.
Everything generally works, <tcdl:Link>
tags make it into the COMPONENT_PRESENTATIONS
table and are resolved when the page is rendered. However since this DCP is used on multiple pages I cannot set the origin attribute on the tcdl:link
tag during publish. I know this means the link resolution will not be cached, it also results in a page linking to itself sometimes. I reviewed some posts, including this one by Mihai (Passing the PageURI to a DCP for Dynamic Linking) but that only applies to DCPs stored in the file system. I know I can set template priority to solve this problem in this particular instance by making the detail CP higher priority but I'm wondering if there is a way to use the origin attribute properly in this situation.
Additional Information:
I am using Razor mediator for templating, ASP.NET for delivery, pages and binaries are stored in the file system with everything else in the DB.
My link tag as it exists in the COMPONENT_PRESENTATIONS
table:
<tcdl:Link type="Component" origin="tcm:0-0-0" destination="tcm:42-215" templateURI="tcm:0-0-0" linkAttributes=" title="Available content component types"" textOnFail="true" addAnchor="false" variantId="">Available content component types</tcdl:Link>
Thanks.