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

Forums / Bugs & Issues / Sitefinity 4.0 and DIV madness

Sitefinity 4.0 and DIV madness

8 posts, 0 answered
  1. UI Crew
    UI Crew avatar
    151 posts
    Registered:
    27 Sep 2012
    10 Dec 2010
    Link to this post
    Hi,

    So far I am very impressed with Sitefinity 4.0 however one of the issues I have now that I have a website in production is the amount of extra code it puts into your site - It's div crazy!

    Take the navigation control for instance - Sitefinity 3.x output one extra RadMenu div around the unordered list where as Sitefinity 4.0 adds an additional 2 divs around the RadMenu:

    <div id="Navigation_TEF52C714000">
       <div id="Navigation_TEF52C714000_ctl00_conditionalTemplate">
          <div id="ctl00_Navigation_TEF52C714000_ctl00_siteMapControl" class="RadMenu RadMenu_PrimaryNav">
          <!-- RadMenu Unordered list here -->
          </div>
       </div>
    </div>

    Even the Content Control puts extra markup around the content under its controls 

    <div class="sfContentBlock">
       <!-- Content -->
    </div>

    And then if you develop any of you own controls using SimpleView you get wrapper spans being placed into you page without warning (I think this actually breaks validation doesn't it because you can't have spans around block elements):

    <span id="Slider_C015">
       <!-- Your SimpleView controls HTML probably containing block elements -->
    </span>

    Lastly, if you don't want to use Sitefinity's layout controls or CSS you don't seem to be able to stop the layout Stylesheet from being rendered either (you might be able too but I couldn't find any details).

    All this is ok for smaller company sites but the user experience working group at our state government agency would have a field day when a site gets submitted for evaluation (they are crazy about excess markup).

    Also I have a few clients that have team members that are quite fussy as well and these are often the people influencing decisions when it comes to acquiring systems such as Sitefinity.

    I would be interested in any thoughts you have on my evaluation.

    Cheers,


  2. Chris
    Chris avatar
    2 posts
    Registered:
    23 Jun 2010
    10 Dec 2010
    Link to this post
    Hey there,

    i have got exactly the same issue with several Sitefinity Controls and Layout Containers.

    If i am using a self made masterpage and try to drop some Sitefinity Layout Containers on my page, it is going crazy in edit mode. There isn`t even a chance to change the properties of the Layout Containers.

    Attached you will find a screenshot which describes my issue way better than i could.

    Do you have any suggestions? When will this issue be fixed?

    Thanks in advance for your trouble.

    Chris




  3. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Dec 2010
    Link to this post
    Hi Webinsite,

    Thank you for your feedback. It is very useful for us.

    We will consider reducing the number of wrapping DIVs. I am not sure it will be possible for all cases but we will try. Sometimes extra DIVs are needed for binding reasons. As for the Navigation widget, it is wrapped in a conditional template so we don't have a different ASCX file for each mode but all navigation templates are included in one file. The two extra DIVs in this case are the wrapping DIV of the widget and the wrapping DIV of the condition. We will consider how to optimise HTML for such cases as well.

    The Content block control has a default CSS class which is added to an additional DIV. We will change the control so if you delete the CSS class (it is in Advanced properties) not DIV will be rendered.

    The wrapping SPANs are rendered around ASP.Net controls by default. You can turn this SPAN into a DIV or remove it if you override methods like RenderBeginTag and RenderEndTag, or TagKey.

    We will fix the issues with the CSS layout file being linked to pages that don't use Layout widgets for official Sitefinity release.

    Let us know if you have further comments or you need help.

    All the best,
    Georgi
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. UI Crew
    UI Crew avatar
    151 posts
    Registered:
    27 Sep 2012
    10 Dec 2010
    Link to this post
    Hi Chris,

    You need to be careful with masterpage contentplaceholder design. This was also the case in 3.x and probably more so with 4.0 cause of the clever new layout controls. Which are quite good.

    The issue arises because to give you clear drag and drop regions Telerik has had to inject borders, text, boxes etc so that the user can see where to drop the controls, sometimes if the content area is too small to contain the Sitefinity control containers and their elements when in edit more you get some strange looking behaviour.

    This might be the situation you are seeing. Sometimes it is a matter of messing around with you CSS so that it can cater for the changes in edit mode.

    If you want to attach the CSS and masterpage I can have a look for you.

    Cheers,

    Seth
  5. UI Crew
    UI Crew avatar
    151 posts
    Registered:
    27 Sep 2012
    10 Dec 2010
    Link to this post
    Hi Georgi,

    Understand. The team just needs to be mindful that this stuff is seriously consider particularly in government sectors, in Australia anyhow. I have seen some teams totally dismiss a good .Net app purely because of the messy HTML. Indeed in my own sites I try to keep them as clean as possible. 

    A content edit is rarely going to go into advanced props to delete a call etc. in  fact I would rather they stay away from that sort of stuff.

    I think it would be better if you could use the widget templates area to change the default Generic Content wrapper class or remove it all together for any new GC controls you drop on the page from that point on.

    I think it would be worthwhile to get a team member to spend a few days getting widget output as mean and lean as possible. That's all they do... get this output as sweet and as clean as possible before release!

    Cheers,

    Seth
  6. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    10 Dec 2010
    Link to this post
    Div around the content block should always be there! :)

    There's no many cases where you need to set a style specifically to what's in a GC block

    (please keep that one) :)
  7. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    27 Feb 2013 in reply to Steve
    Link to this post

    5.4 question

    I create a .master with my div (green in screenshot) and added in Sitefinity a layout region.

    Gave the layout region same classes (wrapper, left, right) 

    a) the div still render style= can this be prevented

    b) the created <div seem to have an extra div in it by default - can this be prevented

    c) am I doing something wrong?

    Screenshot might explain it a bit better.

    Markus

  8. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    27 Feb 2013 in reply to Markus
    Link to this post

    @Markus

    How did you manage to get the markup like that?

    75%+17% != 100, and where's the "sf_2cols_1_75 and sf_2cols_2_25" classes on the Out div?

    Seems that any change to the editor puts all the options onto the elements, it's not checking to see if 75 and 25 have been changed...I can't see this being a huge priority :)

8 posts, 0 answered