Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Scrolling Text Web Part View modes: 
User avatar
Member
Member
donal073-eircom - 11/25/2009 3:29:55 PM
   
Scrolling Text Web Part
I made a web part consisting of scrolling text which draws information from the events calendar and displays the date and event title and it functions as it should. However I want the event scroller to display only events that are scheduled from the current date and the future. As it is it displays all events. Unfortunately I have no idea how to make it do this for me and would appreciate any help from anyone.
Many thanks in advance.

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 11/28/2009 3:37:59 AM
   
RE:Scrolling Text Web Part
Hello,

You can use custom macro to get current date in WhereCondition property of web part. You can use following code for macro:

case "currentdate":
match = true;
result = DateTime.Now.ToShortDateString();
break;

and then use following expression in WhereCondition:

EventDate > '{% ProcessCustomMacro("currentdate", "") %}'

Best Regards,

Martin Dobsicek

User avatar
Member
Member
donal073-eircom - 11/28/2009 7:39:09 AM
   
RE:Scrolling Text Web Part
Thanks for the answer Martin and forgive my ignorance in this.

I think you mean to put the expression "EventDate > '{% ProcessCustomMacro("currentdate", "") %}'"
in the WhereCondition of the Configure Web Part?

As for the macro code you provided, I do not know where to put that at all and maybe you could tell me?
Thanks for your help.

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 12/6/2009 6:04:10 AM
   
RE:Scrolling Text Web Part
Hi Donal,

Yes, I meant to put the expression "EventDate > '{% ProcessCustomMacro("currentdate", "") %}'"
in the WhereCondition of the Configure Web Part.

Please see 'Custom macros' section in 'Appendix A - Macro expressions' article in Dev.Guide for more details about how to implement custom macro.

Best Regards,

Martin Dobsicek