Installation and deployment Questions on installation, system configuration and deployment to the live server.
Version 6.x > Installation and deployment > Hide Empty Zones View modes: 
User avatar
Certified Developer 8
Certified Developer 8
sparker-pmcworld - 1/3/2012 4:36:20 PM
   
Hide Empty Zones
I have a template that has a couple zones that allow customization by page editor. Is there is a way to set the visibility or change the category based on if any widgets are in the zone?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/4/2012 2:48:46 AM
   
RE:Hide Empty Zones
Hi,

Could you please explain it in more details why you want to do this? It does not make any sense - are you using content before/after properties of the zone? Which categorey change you mean?

Best regards,
Juraj Ondrus

User avatar
Certified Developer 8
Certified Developer 8
sparker-pmcworld - 1/4/2012 10:04:13 AM
   
RE:Hide Empty Zones
Sorry, doing two things at the same time, the "Category" thing does not make sense!

I have a page layout that has a couple zones, some of them allow editors to set widgets the others have editable text or other web parts set.

If a editor does not add any widgets to the zone I would like the zone container to be set to none or the visibility of the zone to change. This will ensure that the absence of controls in the zone will not leave the container spacing.

The main reason I am going through this trouble is to give the editors a set number of templates that they use for most of their pages. I want them to get the most out of a few templates as opposed to barely using a lot of templates (having to manage all of those page templates and have them be confused).

If there is a better way of thinking of this, please let me know.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 1/5/2012 2:31:34 AM
   
RE:Hide Empty Zones
Hi,

It makes more sense now. Unfortunately, there is no easy setting for this - I have added it as a requirement for future versions.

Right now, the only way I see is to use a custom macro in the visibility field of the zone.

In the code of custom macro you will need to get the current page information, parse the XML definition for given page template and page to see whether there are any widgets or not and return true/false value.

Best regards,
Juraj Ondrus