Design and CSS styles
Version 5.x > Design and CSS styles > Removing site-wide web part for *one* page View modes: 
User avatar
Member
Member
lars.kvanum-viasat - 3/10/2010 2:09:09 AM
   
Removing site-wide web part for *one* page
Is this possible? The way our site is laid out is that it has several menu web parts defined for the whole site. (top and left++) My boss wants me to remove the left menus on one subpage without affecting the rest of the site, and I have *no* experience with this CMS.

Cheers :)

User avatar
Kentico Support
Kentico Support
kentico_radekm - 3/12/2010 4:53:15 AM
   
RE:Removing site-wide web part for *one* page
Hello.

You can try to set Visible property of the web part to true/false according to e.g. document´s alias path (or other property). When you open properties of your web part, you can edit Visible property and use following macro expression, which returns true (so it is visible) according to current NodeAliasPath. For example, you can use it this way:

(example macro: {%UserName == "administrator"%} writes true)
Example for you:

{%CMSContext.CurrentDocument.NodeAliasPath == "/Home"%}

This ensure that the web part will be hidden on a page with /Home alias path.

Best Regards,
Radek Macalik

User avatar
Member
Member
andrewmacpherson - 2/17/2012 6:57:27 AM
   
Removing site-wide web part for a site section based on path
This was a useful answer. You can use a lot of varations on this.

Example: hide the web-part in a section of the site.

I've got a 'latest news' repeater which appears in the sidebar of most pages. It's not needed in the news section itself though, so this will hide a it on /news and all child pages...

{%not(Contains(CMSContext.CurrentDocument.NodeAliasPath, "news"))%}