Remove generated HTML

Topics: Core, Writing themes
Aug 6, 2013 at 11:56 AM
Edited Aug 6, 2013 at 11:58 AM
When I use the Display method to render a menu, even in an alternate template, it renders a bunch of HTML I didn't ask for. Specifically, the below wraps my own markup:

__div class="zone zone-navigation"
article class="widget-navigation widget-menu-widget widget"__

Overriding the menu template seems not to help, as it seems to be coming from the behavior of 'Display()' and the associated 'Shape/Model'.

As this is adversely affecting the CSS I am using in the theme I am adapting (a WordPress theme), I was hoping this could be avoided? Surely Orchard doesn't have to inject its own HTML markup - that would indeed be extremely off putting?
Aug 6, 2013 at 3:48 PM
Ahhh, my answer lies in this post: - its a case of the developer having to remove it. Its supposed to be the developer/designer that adds it!

It seems odd to me that this high level presentation HTML markup is specified at that low a level in the system (or rather, such a non-intuitive place). And the answer apparently is that you need to remove it by enabling a certain feature, and then overrriding a certain template. (As explained in above link)
Aug 6, 2013 at 7:27 PM
How is this at a low level? The system has to provide default markup. If you don't like the default rendering, that's fine, you can change it in your theme. I'm not sure I see what the problem is here.
Aug 7, 2013 at 2:22 AM
Edited Aug 7, 2013 at 2:23 AM
Just opinion mind you, but I would say the system should provide 'the bare minimum' of default markup. Specifying the additional markup is overkill, and not really solving any particular problem.

Or put another way - this choice the system makes to add additional markup where a simple list (ul, li) would suffice, is a choice that designers prefer to have themselves. While the answer is 'out there', it isn't obvious.

Or put another way - it is much easier for a designer to add such extra tags if she needs them, than it is to actually remove them if they don't want them.

It is ok that you now how to remove them (as I now do), but this isn't really where I'm coming from. This topic seems to pop up in a few places, such as:

Remove overkill html in Navigation Zone:

Hot to get rid of the article tag in my navigation? :

And quite a few others if you do relevant searches.

It seems to pop up more for designers creating themes from scratch, or as in my case, wanting to convert an existing themes with established CSS. So not a problem as such, just an unusual approach I thought (my recent background has been Umbraco).
Aug 7, 2013 at 7:39 AM
Yes, opinion. Orchard tends to be rather opinionated, so it's hardly surprising that some would disagree with some of these choices. Case in point, a zone can't be just a ul, because that would mandate all of its contents to be lis. Seeing as arbitrary shapes can be added to any zone, that's not a good choice for the framework to make. Your assumption that "it's not solving any particular problem" may be a little premature. We do need additional containers in many places, in order to keep the system flexible. And as everything can be overridden (which is hardly an undiscoverable fact), I really don't see a problem here. You see this as a problem because you are trying to adapt markup that was made for another platform that itself has a different set of assumptions. Someone trying to do the reverse conversion would probably have the symmetrical problem, not necessarily the fault of one platform or the other.
Aug 7, 2013 at 9:35 AM
Thanks, appreciate you taking the time to reply.
Aug 7, 2013 at 10:02 PM
Also, don't look at Twitter Bootstrap, it will give you nightmares ;)