Sitefinity 4.0 and DIV madness

Posted by Community Admin on 04-Aug-2018 08:41

Sitefinity 4.0 and DIV madness

All Replies

Posted by Community Admin on 10-Dec-2010 00:00

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,


Posted by Community Admin on 10-Dec-2010 00:00

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




Posted by Community Admin on 10-Dec-2010 00:00

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

Posted by Community Admin on 10-Dec-2010 00:00

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

Posted by Community Admin on 10-Dec-2010 00:00

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

Posted by Community Admin on 10-Dec-2010 00:00

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) :)

Posted by Community Admin on 27-Feb-2013 00:00

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

Posted by Community Admin on 27-Feb-2013 00:00

@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 :)

This thread is closed