1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Visibility set on controls breaks template editor

Visibility set on controls breaks template editor

3 posts, 0 answered
  1. Darren
    Darren avatar
    72 posts
    Registered:
    19 Mar 2008
    05 Jun 2008
    Link to this post
    Does anyone have a problem using controls in templates with visibility set to false such as menu's or tabbed areas set to be invisible?
    I've found that when I set some controls to be invisible the editor breaks so I can't add/delete controls and sometimes can't publish pages either.

    This is a pain since I'm having to set all controls to be visible while working with templates which can sometimes entail changing the property on dozens of controls.
    Also I can't expect non-developers to do this with the live CMS.

    Thanks
  2. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    06 Jun 2008
    Link to this post
    Hi Darren,

    To get around this maybe you could try putting in the PreRender void of your controls to check if the control is in edit mode and set you controls visibility to true in that instance something like:

    if (Request.Querystring["cmspagemode"]=="edit"
         this.Visible=true;     

    Cheers
    Sean

  3. Darren
    Darren avatar
    72 posts
    Registered:
    19 Mar 2008
    06 Jun 2008
    Link to this post
    That's a nice solution to the problem with the added side benefit of making all controls visible through the editor as well.
    I'll give it a go later but should work well.

    Thanks for the suggestion.
Register for webinar
3 posts, 0 answered