I am building a primarily dynamic website in .NET and am trying to get UGC to work in conjunction with my Dynamic Component Presentations. My DCPs are being published using the REL output format (to the broker db), and are being consumed using the ComponentPresentationAssembler class.
The DCPs contain both a dynamic link and UGC PostRating. At runtime the dynamic link is successfully resolved, however the UGC code is not.
Example of DCP content in database:
<div>
<h2><tcdl:Link type="Component" origin="tcm:0-0-0" destination="tcm:33-10793" templateURI="tcm:0-0-0" linkAttributes="" textOnFail="true" addAnchor="false" variantId="">Basic Business Checking</tcdl:Link></h2>
<tcdl:PostRating itemURI="tcm:33-10793" postParameter="ratingValuetcm:33-10793">
<tcdl:ItemStats itemURI="tcm:33-10793">
Rating:<tcdl:ContextVariable var="ugcItemStats.averageRating"/> (<tc dl:ContextVariable var="ugcItemStats.numberOfRatings"/> ratings)<br/>
</tcdl:ItemStats>
<form method="post" id="ratingForm">Rate:
<select name="ratingValuetcm:33-10793" size="1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5" selected="true">5</option>
</select>
<input type="submit" value="Rate!"/>
</form>
</tcdl:PostRating>
</div>
.NET page code:
Query myQuery = new Query();
myQuery.Criteria = andCriteria;
string[] componentPresentationURIs = myQuery.ExecuteQuery();
ComponentPresentationAssembler componentPresentationAssembler = new ComponentPresentationAssembler("tcm:33-10796-64");
foreach (string componentPresentationURI in componentPresentationURIs) {
Response.Write(componentPresentationAssembler.GetContent(componentPresentationURI, strComponentTemplateURI));
}
UGC is working successfully when deployed embedded on a page.
cd_dynamic_conf.xml is configured with ugc_renderer_bundle.xml tag bundle.
In the rendered html the dynamic link is resolved to
<a href="/prodigy/business-rewards-checking.aspx" >Business Rewards Checking</a>
However the code remains as is.
And ideas would be welcome.