Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Related documents in repeater View modes: 
User avatar
Member
Member
epogburn-nola - 7/5/2012 1:19:21 PM
   
Related documents in repeater
I'm using the following code to display related documents in a repeater:
<cms:CMSRepeater ID="repElem" runat="server" DelayedLoading="true" Path="/%" TransformationName="CMS.Root.RelatedDocuments" RelationshipName="isrelatedto" RelatedNodeIsOnTheLeftSide="true" RelationshipWithNodeGUID='<%# ValidationHelper.GetGuid(Eval("NodeGUID", true), Guid.Empty) %>'  />

However, the result displays every document in the tree instead of just the related document. If I manually add a NodeGUID, it works:
RelationshipWithNodeGUID='ec7ce045-8e57-473d-9d65-d7a4c485cfdd'

What am I missing? This tag <%# ValidationHelper.GetGuid(Eval("NodeGUID", true), Guid.Empty) %> displays the correct NodeGUID when I display it, but not when applied to the repeater.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/6/2012 5:52:42 PM
   
RE:Related documents in repeater
Hi,

please find a working example below:
<cms:CMSRepeater ID="repElem" runat="server" Path="/%" RelationshipName="isrelatedto" TransformationName="CMS.Root.RelatedDocuments" RelationshipWithNodeGuid='<%#Eval<Guid>("NodeGUID")%>'  />

<script runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
repElem.ReloadData(true);
// or repElem.ReloadData();
}
</script>

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Benj - 1/17/2014 9:35:20 AM
   
RE:Related documents in repeater
I am getting the same behaviour here in v7.0.44 in a transformation.

If I hard-code the guid in the CMSRepeater in the transformation it works, but doing it using:

RelationshipWithNodeGUID='<%# Eval<Guid>("NodeGUID") %>'

Returns all of the documents of the relevant ClassNames.

Help?

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/18/2014 9:49:11 PM
   
RE:Related documents in repeater
Hello,

why you simply don't use the following:
<%# Eval("NodeGUID") %>

Best Regards,
Martin Danko

User avatar
Member
Member
Benj - 1/19/2014 8:28:51 AM
   
RE:Related documents in repeater
Still the same. Here's my code in case you can see something else I've done:

<cms:CMSRepeater ID="CompatibilityCMSRepeater" runat="server" TransformationName="company.product.CompatibilityPreview" RelationshipName="IsCompatibleWith" ClassNames="company.product" RelationshipWithNodeGUID='<%# Eval("NodeGUID") %>' Path="/%" ItemSeparator=", " />