Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 11 of 11

Thread: Vector and Genres Breadcrumbs

  1. #1
    ASP_Newbie is offline Junior Member
    Join Date
    Sep 2007
    Posts
    9

    Question Vector and Genres Breadcrumbs

    I did a search on bread crumbs and got some things, but nothing that I believe can help my situation. If I missed it, forgive me.

    Ok, I have AspDotNetStorefront ML 7.1.0.0/7.1.0.0.

    I would like to know how I can get the breadcrumbs to work for Vectors and Genres. I believe by solving this I will also fix two other issues:

    The "Blue Arrows" functionality in Vectors and Genres.

    Having the "Site Map" show Vectors and Genres

    I am hoping these all have to do with the same process. Thanks for any help.


    .
    "In an insane world, a sane man must himself appear insane."

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    There are quite a few sections that need to be un-commented in the code in order for Genres and Vectors to become completely functional. Give me a day or so to find the sections for this particular functionality.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    ASP_Newbie is offline Junior Member
    Join Date
    Sep 2007
    Posts
    9

    Default

    George, my man. You're my favorite Staff member.

    We are about to hit the heavy season and I am tweaking and checking. So far only a few minor problems left.
    Thanks!
    "In an insane world, a sane man must himself appear insane."

  4. #4
    Rob is offline Senior Member
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    yeah, G1 is the man, but shhhh...stop telling him that, as it just goes to inflate his poker head
    AspDotNetStorefront
    Shopping Cart

  5. #5
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default Adding Genre/Vector functionality in 7.1.1 C#

    Alright...in order to get Vectors and Genres up and running, you'll need the following files:
    • Admin/entityEditProducts.aspx.cs
    • App_Code/TemplateBase.cs
    • skins/Skin_#/menuData.xml
    • Admin/skins/Skin_#/menuData.xml
    • ASPDNSFCommon/SiteMapComponentArt.cs (needed to add Genres and Vectors to the site map...only available with full source code)


    First, let's make sure that genres and vectors can be viewed in the admin section. In the admin/skins/Skin_#/menuData.xml file, add these two lines
    Code:
    <item Text="(!admin.menu.Genres!)" NavigateUrl="entityframe.aspx?entityname=genre" LookId="TopItemLook" />
    <item Text="(!admin.menu.Vectors!)" NavigateUrl="entityframe.aspx?entityname=vector" LookId="TopItemLook" />
    Next, let's make sure customers browsing the front end can access genres and vectors from the top, horizontal nav menu. In the skins/Skin_#/menuData.xml file, add these two lines
    Code:
    <item Text="(!menu.Genres!)" LookId="TopItemLook" />
    <item Text="(!menu.Vectors!)" LookId="TopItemLook" />
    Now let's make sure that customers can navigate the front end menu items (eg. the vectors and sub-vectors will dropdown under the main menu header like the existing entities). This will also take care of the expanding menu in the admin section. Open the App_Code/TemplateBase.cs file. Find a section of code in private void Page_Load that is for distributors
    Code:
    // Find Distributors menu top
    mNode = doc.DocumentElement.SelectSingleNode("//item[@Text='(!" + CommonLogic.IIF(AppLogic.IsAdminSite, "admin.", "") + "menu.Distributors!)']");
    tblMgr = AppLogic.DistributorEntityHelper.m_TblMgr;
    if (tblMgr.NumRootLevelNodes <= AppLogic.MaxMenuSize())
    {
        AddEntityMenuXsl(doc, "Distributors", tblMgr, mNode, 0, String.Empty);
    }
    mNode = doc.DocumentElement.SelectSingleNode("//item[@Text='(!" + CommonLogic.IIF(AppLogic.IsAdminSite, "admin.", "") + "menu.Distributors0!)']");
    if (tblMgr.NumRootLevelNodes <= AppLogic.MaxMenuSize())
    {
        AddEntityMenuXsl(doc, "Distributors", tblMgr, mNode, 0, "TopItemLook");
    }
    and underneath this add the following lines of code:
    Code:
    // Find Genres menu top
    mNode = doc.DocumentElement.SelectSingleNode("//item[@Text='(!" + CommonLogic.IIF(AppLogic.IsAdminSite, "admin.", "") + "menu.Genres!)']");
    AddEntityMenuXsl(doc, "Genre", AppLogic.GenreEntityHelper.m_TblMgr, mNode, 0, String.Empty);
    mNode = doc.DocumentElement.SelectSingleNode("//item[@Text='(!" + CommonLogic.IIF(AppLogic.IsAdminSite, "admin.", "") + "menu.Genres0!)']");
    AddEntityMenuXsl(doc, "Genre", AppLogic.GenreEntityHelper.m_TblMgr, mNode, 0, "TopItemLook");
    
    
    // Find Vectors menu top
    mNode = doc.DocumentElement.SelectSingleNode("//item[@Text='(!" + CommonLogic.IIF(AppLogic.IsAdminSite, "admin.", "") + "menu.Vectors!)']");
    AddEntityMenuXsl(doc, "Vector", AppLogic.VectorEntityHelper.m_TblMgr, mNode, 0, String.Empty);
    mNode = doc.DocumentElement.SelectSingleNode("//item[@Text='(!" + CommonLogic.IIF(AppLogic.IsAdminSite, "admin.", "") + "menu.Vectors0!)']");
    AddEntityMenuXsl(doc, "Vector", AppLogic.VectorEntityHelper.m_TblMgr, mNode, 0, "TopItemLook");
    Now let's make sure that when the product is added from the admin section, it maps properly when being added. Open the Admin/entityEditProducts.aspx.cs file and find protected void LoadContent(). About part way down you'll find the beginning of a rather large if statement
    Code:
    if (Editing)
    {
        TabStrip1.Tabs[TabStrip1.Tabs.Count - 1].Visible = false;
        this.phAllVariants.Visible = true;
        this.phAddVariant.Visible = false;
    
        SetVariantButtons();
        ....
        ....
    You'll need to get to the else part of this
    Code:
    else
    {
        TabStrip1.Tabs[TabStrip1.Tabs.Count - 1].Visible = true;
    
        this.phAllVariants.Visible = false;
        this.phAddVariant.Visible = true;
        divltStatus2.Visible = false;
        ltStatus.Text = "Adding Product";
        btnSubmit.Text = "Add New";
        ....
        ....
    Near the bottom of this else statement you'll find a section for mappings and in this section there is an affiliate section
    Code:
    //Affiliate
    if (eName.Equals("AFFILIATE", StringComparison.InvariantCultureIgnoreCase))
    {
        foreach (ListItem li in cblAffiliates.Items)
        {
            if (li.Value.Equals(eID.ToString()))
            {
                li.Selected = true;
            }
        }
    }
    Under this you'll need to add the following
    Code:
    //Genre
    if (eName.Equals("GENRE", StringComparison.InvariantCultureIgnoreCase))
    {
        foreach (ListItem li in cblGenres.Items)
        {
            if (li.Value.Equals(eID.ToString()))
            {
                li.Selected = true;
            }
        }
    }
    
    //Vector
    if (eName.Equals("VECTOR", StringComparison.InvariantCultureIgnoreCase))
    {
        foreach (ListItem li in cblVectors.Items)
        {
            if (li.Value.Equals(eID.ToString()))
            {
                li.Selected = true;
            }
        }
    }
    Now, to include vectors and genres in the sitemap (if you have the full source code version). Open up the ASPDNSFCommon/SiteMapComponentArt.cs file. In public SiteMapComponentArt you'll find some if statements that look like
    Code:
    if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowCategories"))
    and
    Code:
    if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowSections"))
    After one of these if blocks, you can add the following code
    Code:
    if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowVectors"))
    {
        // Categories:
        String s = AppLogic.LookupHelper("Vector").GetEntityComponentArtNode(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, true, AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowProducts") && AppLogic.NumProductsInDB < 250);
        if (s.Length != 0)
        {
            if (AppLogic.IsAdminSite)
            {
                tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.VectorPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\" NavigateUrl=\"entityframe.aspx?entityname=category\">\n");
            }
            else
            {
                tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.VectorPromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\">\n");
            }
            tmpS.Append(s);
            tmpS.Append("</node>");
        }
    }
    
    if (AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowGenres"))
    {
        // Categories:
        String s = AppLogic.LookupHelper("Genre").GetEntityComponentArtNode(0, ThisCustomer.LocaleSetting, ThisCustomer.AffiliateID, ThisCustomer.CustomerLevelID, true, AppLogic.IsAdminSite || AppLogic.AppConfigBool("SiteMap.ShowProducts") && AppLogic.NumProductsInDB < 250);
        if (s.Length != 0)
        {
            if (AppLogic.IsAdminSite)
            {
                tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.GenrePromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\" NavigateUrl=\"entityframe.aspx?entityname=genre\">\n");
            }
            else
            {
                tmpS.Append("<node Text=\"" + XmlCommon.XmlEncodeAttribute(AppLogic.GetString("AppConfig.GenrePromptPlural", SkinID, ThisCustomer.LocaleSetting).ToUpperInvariant()) + "\">\n");
            }
            tmpS.Append(s);
            tmpS.Append("</node>");
        }
    }
    Then recompile the ASPDNSFCommon project, and upload the new AspDotNetStorefrontCommon.dll to your site's /bin directory (after a backup of the original of course ). The create 2 new appconfig parameters called SiteMap.ShowGenres and SiteMap.ShowVectors, and set both of these appconfig values to true. The genres and vectors should then be showing in your sitemap.

    See screenshots for results The navigation arrows are difficult to screenshot, but these also properly navigate through the vectors/genres and the products that are mapped to them.
    Attached Images Attached Images    
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  6. #6
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    Can I get these instruction for v9 or are they posted somewhere?
    Thanks!
    MSX

  7. #7
    virtualtap is offline Senior Member
    Join Date
    May 2007
    Posts
    171

    Default

    Actually I got it all figured out for v9, but while I got genre to show up in the site map, I can't seem to get the vector to show.


    in the SiteMapComponentArt.cs
    should it be
    entityframe.aspx?entityname=category\">\n");
    or
    entityframe.aspx?entityname=vector\">\n"); ?

    I tried both ways but I still cant get vector to show up
    it is set to true in appConfig.

    Just noticed that while the genre and vector showed up on the horizontal menu the drop down is not working

    Thanks
    Last edited by virtualtap; 12-23-2010 at 07:01 PM.
    MSX

  8. #8
    JustBen is offline Junior Member
    Join Date
    Nov 2008
    Posts
    17

    Default V9 Vectors

    I would also like to get this working in version #9

  9. #9
    Upscale_Automotive is offline Senior Member
    Join Date
    Apr 2008
    Posts
    201

    Default

    Advice on getting Genre/Vector mapping to work on EntityEditProducts.aspx.cs for v8.0.1.4? I have tried the suggestions here to no avail.

  10. #10
    kwa1207 is offline Junior Member
    Join Date
    Nov 2008
    Posts
    9

    Default

    I aslo have a 7.1.0.0 store front and would like to activate Vectors and Genres in my horizontal menu on an old site that is getting overhauled. However after following these instructions I still end up with the same issue my Genre and Vector Menu does not dropdown to display the entities or sub entities. Any help here would be great!

    Here is a link to my page that we are working on. www.ctperformancediesel.com

  11. #11
    batteryguy is offline Junior Member
    Join Date
    May 2009
    Posts
    8

    Default V9.3 Manage Genre and Vector Mappings from Admin

    Anyone have instructions on how to enable managing genre and vector mapping from the admin for version 9.3?

    I'm assuming that entityEditProducts.aspx needs to be modified but don't know where to start....