Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Publish To and From Dates in Webparts View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/19/2010 8:39:48 AM
   
Publish To and From Dates in Webparts
Has anyone setup any publish to and from dates on webparts similar to how Articles and News items are setup? I'd like to have several webparts with this functionality on it so I can dynamically show and hide text, images, repeaters, etc by a date instead of having to do it so manually.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/19/2010 9:30:17 AM
   
RE:Publish To and From Dates in Webparts
Hi,

you can create your custom macro that will compare actual time with preset time and return bool value.

Than in Properties of webpart (in Visibility part) insert this macro code:
{% ProcessCustomMacro("your_custom_macro_name", "") %}

Best regards,
Ivana Tomanickova

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 8/19/2010 4:28:04 PM
   
RE:Publish To and From Dates in Webparts
Makes perfect sense now. Only question is how can I pass the start and end parameters into the custom macro? Would I follow this and add them to the macro name and parse it out?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/20/2010 2:55:56 AM
   
RE:Publish To and From Dates in Webparts
Hi,

Yes, you are right. It is a suggested way how to pass argument into custom macro code.

Best regards,
Ivana Tomanickova