Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Visibility based on transformation View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 12/2/2011 1:39:03 PM
   
Visibility based on transformation
I'd like to set the visibility on a webpart based on the transformation selected or being shown in a different webpart. Can this be done with a Macro if so, how?

For instance I have an editable text webpart that I want to hide when someone clicks the details of a record in a datalist webpart.

User avatar
Kentico Support
Kentico Support
kentico_janh - 12/4/2011 5:26:20 AM
   
RE:Visibility based on transformation
Hello,

I think the easiest way how to achieve this is through the NodeLevel property of a current document, because the selected item transformation is applied on documents on different level than your datalist webpart is located. So the visibility macro could look like the following one:
{%CurrentDocument.NodeLevel == 1;%}

Best regards,
Jan Hermann

User avatar
Certified Developer 9
Certified Developer 9
charbf - 12/4/2011 1:14:39 PM
   
RE:Visibility based on transformation
Hi,

you can also use the visibility property : Hide on subpages

since the subpage is probably the same template you can probably acheive what you need with this property

Francois

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 12/4/2011 2:55:37 PM
   
RE:Visibility based on transformation
Thank you both for the replies. I"ve used both suggestions on my site. I used the NodeLevel == 1 as a visibility macro and also in the WebPart Container Hide on subpages as a macro and it works great. I used the Hide on subpages on any webpart I just don't want to show at all, like the editable text webpart.

Thanks for the assistance!