1

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.

4

1 回答 1

1

首先,一个小评论:“REL 标签无法发布评论/评级”(检查使用 Tridion 记录的增强请求 76605)。这基本上意味着您的“tcdl:PostRating”将从结果输出中删除。就“tcdl:ItemStats”和“tcdl:ContextVariable”而言,如果您在“cd_storage_conf.xml”中有“ugc_dao_bundle.xml”设置,它们应该可以正常工作。结果,您将使用所有评论呈现整个页面,但评论/评级的发布或编辑将不起作用。如果您的渲染有问题,那么您应该会在日志中看到一些错误。希望这可以帮助。

干杯,丹尼尔。

于 2012-10-30T10:05:28.837 回答