Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > QueryString Macro in Repeater Webpart Where View modes: 
User avatar
Member
Member
snk1324 - 6/29/2011 3:07:29 PM
   
QueryString Macro in Repeater Webpart Where
I have the following in the Where Condition for a repeater webpart

Year(ReleaseDate) >= {%year|(default)1900%} and Year(ReleaseDate) <= {%year|(default)2500%}

The query string macro is not resolved, and so the repeater gives me an error. What's wrong with this? According to the docs, Query String macros can be used in webpart properties.

http://www.kentico.com/docs/devguide/index.html?appendix_a___macro_expressions.htm

Using 5.5R2

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 7/4/2011 2:48:37 AM
   
RE:QueryString Macro in Repeater Webpart Where
Hello,

Yes, query macros can be definitely used in the web part properties. The thing is there needs to be used correct document type field name in that where condition. In your case the field name isn't probably Year(ReleaseDate) because there isn't allowed to use special characters in the attribute name.

In your case it could look like this:

YearField >= {%year|(default)1900%} and YearField <= {%year|(default)2500%}

Does this make sense?

Best regards
Ondrej Vasil

User avatar
Member
Member
snk1324 - 7/11/2011 8:21:16 AM
   
RE:QueryString Macro in Repeater Webpart Where
Ok, you completely mis-understand what I am trying to do. Year(ReleaseDate) is valid. Year() is a SQL function. So, it is grabbing the year part of the field ReleaseDate. The problem is that the query macro fails. I was able to work around this by cloning the webpart and putting the check for the query parameter there. However, the failure of the query macro in the webpart property is a bug as it does not work.

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 7/11/2011 9:28:09 AM
   
RE:QueryString Macro in Repeater Webpart Where
Hello,

I believe I got it, however I wasn't able to reproduce it anyway. Since you have a valid maintenance, may I ask you to send me access credentials to your site to support@kentico.com? This way I'll be able to see this behavior?

Thank you in advance.

Best regards
Ondrej Vasil