Kentico - CMS Repeater WhereCondition and DocumentURLPath issue with incorrect path/url

Viewed 44

I have a custom Web Part which uses cms:cmsrepeater with a "WhereCondition" and also "classnames" in order to filter the items. My problem is that when I try to use a dynamically-calculated path for the WhereCondition, I seem to get the incorrect items in the repeater.

I have the following method in the code-behind file for the Web Part:

Parent Alias Path

We can see that this method returns the correct path which I then use in the WhereCondition in the ascx file, like this:

Where Condition

However, this results in a completely different URL for the Eval("DocumentUrlPath"), like this:

Incorrect URL

If I try to hardcode the path in the WhereCondition, like this:

Hardcoded path

Then I get the correct product attachments(downloads etc.) with the correct href (DocumentUrlPath?):

Correct URL

So I'm trying to use the method instead of hardcoding this because obviously it needs to work for any product/page and get the current document path (or whatever else I need to use) - and look into the Downloads etc.. (files under this page) and load them.

Any help would be appreciated

0 Answers
Related