This project is read-only.
4
Vote

Taxonomy Menu List Order - Internet Explorer

description

The Taxonomy Menu Lists are rendered out of sequence by Internet Explorer - the cause appears to be the initial </li>before starting an <li> element in Views\Parts\Taxonomies.Menu.cshtml.

The following opens and closes all <li> and <ul> elements correctly.

@using Orchard.Utility.Extensions;
@using Contrib.Taxonomies.Models;
@using Contrib.Taxonomies.Helpers;

@{
int level = 0;
int lastLevel = -1;
}
<div class="taxonomy-menu"> @foreach (TermPart term in Model.Terms) { int thisLevel = term.GetLevels(); var text = Model.ContentPart.DisplayContentCount && term.Count > 0 ? (string)term.Name + T(" ({0})", term.Count).Text : (string)term.Name; if (thisLevel > lastLevel) { level++; @:<ul class="terms"> } else { if (lastLevel > thisLevel) { for (int i = thisLevel; i < lastLevel && level > 1; i++ ) { level--; @:</li> @:</ul> } } @:</li> } lastLevel = thisLevel; @:<li>@Html.ItemDisplayLink(text, term.ContentItem) } @for (int i = 0; i < level; i++) { @:</li> @:</ul> } </div>

comments

Jimasp wrote Apr 26, 2013 at 10:43 AM

also, the Style.Include("admin-taxonomy.css") stylesheet referred to by this file has styles for "div.taxonomy-widget" instead of "div.taxonomy-menu".