Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Hide/Show a web part based on the visibility of another web part View modes: 
User avatar
Member
Member
lancetek - 7/5/2011 6:25:27 PM
   
Hide/Show a web part based on the visibility of another web part
Is there a way to hide/show a web part based on the visibility of another web part on the page?

eg: I have a QueryRepeater that may sometimes have no results, and if it doesn't have anything, I'd like to hide it (it already does this when it's empty) and show an 'alternative' static html web part.

The only way that's springing to mind is for me to create a static html custom control that walks the Page's Control Heirarchy to find the QueryRepeater web part I'm interested in, and tweak it's own visibility based on whatever the QueryRepeater is showing.

But I'm thinking there is some super-duper Macro that I can stick in the static html web part's visibility field that can do what I needs.

Thanks,
Lance

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/7/2011 2:05:09 AM
   
RE:Hide/Show a web part based on the visibility of another web part
Hi,

Some kind of communication between web parts is planned for one of the next versions. Right now, the only way is to modify the behavior of the web parts in the code behind. You need to save the state of the repeater in the request and then, the static HTML web part will read this information and according to it it will be displayed or hidden.

Best regards,
Juraj Ondrus

User avatar
Member
Member
nanite2000 - 4/17/2013 5:57:38 PM
   
RE:Hide/Show a web part based on the visibility of another web part
kentico_jurajo wrote: Hi,

Some kind of communication between web parts is planned for one of the next versions. Right now, the only way is to modify the behavior of the web parts in the code behind. You need to save the state of the repeater in the request and then, the static HTML web part will read this information and according to it it will be displayed or hidden.

Best regards,
Juraj Ondrus

Hi,

Has any progress been made on this subject? I'd also like to set the visibility of a web part based on the visibility of another.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/19/2013 10:30:30 AM
   
RE:Hide/Show a web part based on the visibility of another web part
Hi,

You can follow the idea mentioned in this knowledge base article on how to change properties of a web part from another web part.

Best regards,
Juraj Ondrus