Show categories horizontally with dropdown for sub categories

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás
Hi AntonL, my menu is working in IE 7, but in IE 6 menus are distracted. This is because of some of menu.css class which is not supported in IE 6.

I am also working on it. Update soon.

Thanks
Venkat
14 anos atrás
now my menu works in ie6!
14 anos atrás
The parent menu shows up in IE8 however the child menus are not. I'm using 1.50. Please advise. Thanks!
14 anos atrás
This dynamic category navigation is in use at www.tire.biz when you click on "Vehicles".

I did it using the following DataList code:

                            <div id="submenuVehicles" class="anylinkcsscols">
                                <div class="column" id="columnVehicle">
                                    <b>Vehicle Makes</b>
                                    <asp:DataList ID="dlVehicleSubCategories" runat="server" RepeatColumns="4" RepeatDirection="Vertical"
                                        RepeatLayout="Table" OnItemDataBound="dlVehicleSubCategories_ItemDataBound">
                                        <ItemTemplate>
                                            <asp:HyperLink ID="hlCategory" runat="server" />
                                        </ItemTemplate>
                                    </asp:DataList>
                                </div>
                            </div>

This relies on the anylinkcss menuing javascript library - Get it here

and the following codebehind

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using NopSolutions.NopCommerce.BusinessLogic;
using NopSolutions.NopCommerce.BusinessLogic.Categories;
using NopSolutions.NopCommerce.BusinessLogic.SEO;
using NopSolutions.NopCommerce.Common.Utils;

namespace NopSolutions.NopCommerce.Web.Modules
{
    public partial class MenuLeft : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
        protected void BindData()
        {
            int VehicleCategoryID = 7;
            var vehicleCategoryCollection = CategoryManager.GetAllCategories(VehicleCategoryID);
            if (vehicleCategoryCollection.Count > 0)
            {
                dlVehicleSubCategories.DataSource = vehicleCategoryCollection;
                dlVehicleSubCategories.DataBind();
            }
            else
                dlVehicleSubCategories.Visible = false;
        }

        protected void dlVehicleSubCategories_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var category = e.Item.DataItem as Category;
                string categoryURL = SEOHelper.GetCategoryURL(category.CategoryID);
                var hlCategory = e.Item.FindControl("hlCategory") as HyperLink;
                if (hlCategory != null)
                {
                    hlCategory.NavigateUrl = categoryURL;
                    hlCategory.Text = Server.HtmlEncode(category.Name);
                }
            }
        }
    }
}


I hope that's helpful to you.

Jared Nielsen
www.FUZION.org
14 anos atrás
phlat wrote:
The parent menu shows up in IE8 however the child menus are not. I'm using 1.50. Please advise. Thanks!


I found a work around for this, if it helps anyone having the same issue.


Right after the head tag open in Root master place this line:

<!-- Use IE7 mode -->
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
14 anos atrás
I couldnt make it work, is there anything I should add or change?

Thank u
14 anos atrás
I'm sorry but does anybody have a working sample of this?
14 anos atrás
anyone?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.