Banners Extension for 1.9 (Multiple)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
I upgrade Banner Extension form 1.8 to 1.9

Multiple Banners can be same page already resolved.

and it work.

upload it to http://nop23.maxcare.tw
13 years ago
sorry, I forgot to inculde NopObjectContext.ObjectSets.tt, BaseNopUserControl.cs

but it just modify and add using NopSolutions.NopCommerce.BusinessLogic.Advertise; in NopObjectContext.ObjectSets.tt.

then update NopModel.edmx from database again.

modify NopCommerceStore\Controls\BaseNopUserControl.cs, and add

        public IBannerService BannerService
        {
            get { return IoC.Resolve<IBannerService>(); }
        }


modify NopBussinessLigic\Infrastructure\UnityDependencyResolver.cs, and add

container.RegisterType<IBannerService, BannerService>(new UnityPerExecutionContextLifetimeManager());
13 years ago
I also upgrade Contacts, FAQ form 1.8 to 1.9 and upload them to my live skydrive in same place.
13 years ago
Hi,
I'm trying to install in 1.9 version but I have many erros:

File: NopObjectContext.ObjectSets.cs:
Error 1 line 26:  The type or namespace name 'Nop_Banner' could not be found (are you missing a using directive or an assembly reference?)  
Error 2:  'NopSolutions.NopCommerce.BusinessLogic.Data.NopObjectContext.Nop_Banner' is a 'property' but is used like a 'type'

Code:
/// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Nop_Banner> Nop_Banner
        {
            get
            {
                if ((_Nop_Banner == null))
                {
                    _Nop_Banner = base.CreateObjectSet<Nop_Banner>("Nop_Banner");
                }
                return _Nop_Banner;
            }
        }
        private ObjectSet<Nop_Banner> _Nop_Banner;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Banner> Banners
        {
            get
            {
                if ((_Banners == null))
                {
                    _Banners = base.CreateObjectSet<Banner>("Banners");
                }
                return _Banners;
            }
        }
        private ObjectSet<Banner> _Banners;


File: Banner.ascx.cs:
Error 3:  The name 'BannerManager' does not exist in the current context

line 38: List<Banner> lstBanner = BannerManager.GetBannersbyPosition(PositionName);

File: NopModel.edmx
Error 4 line 9:  Error 11007: Entity type 'Banner' is not mapped.


File: NopModel.edmx show me error "Entity type 'Banner' is not mapped".



Someone help me?
13 years ago
cooperchen, do you have an example website with banners we can look at? Thanks!
13 years ago
my example site http://www.maxcare.tw, banner on top of right side.

error1 is cause that your NopModel.edmx operating error. it seem to be you have not rename Nop_Banner to Banner.

error3 cause that I rename BannerManager to BannerService.

error2 and 4 cause error1

otherwise, I renew my banners19 in my live skydrive.
13 years ago
Thank you very much cooperchen!

Now, I have only one error when I access the administration area:

Server Error in '/' Application.
________________________________________

Multiple nodes with the same URL '/administration/banners.aspx' were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: Multiple nodes with the same URL '/administration/banners.aspx' were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.

Source Error:

Line 33:                     var sb = new StringBuilder();
Line 34:                     sb.AppendFormat("<ul id=\"{0}\" class=\"sf-menu\">", ClientID);
Line 35:                     foreach(SiteMapNode node in siteMapProvider.RootNode.ChildNodes)
Line 36:                     {
Line 37:                         BuildMenuRecursive(sb, node);

Source File: C:\inetpub\wwwroot\NopCommerce .Net\NopCommerceStore\Administration\Modules\MenuControl.ascx.cs    Line: 35

Can you help me?
thanks
13 years ago
cooperchen, I got it, my Admin.sitemap was error, ok now.

But the banner does not show!

Have you some ideia?

thanks.
13 years ago
your Admin.sitemap have twice line

<siteMapNode title="Manage Banners" url="~/administration/banners.aspx" ......

check it plz.

you only put one line inside this node <siteMapNode title="Content"....

like these

<siteMapNode title="Content....      
  <siteMapNode title="Manage Banners" url="~/administration/banners.aspx" description="Manage Banners" nopResourceTitle="Admin.Sitemap.BannersTitle" nopResourceDescription="Admin.Sitemap.BannersDescription" />

I am sorry for BacklogBanners.txt that I did not change too much. I already renew my Banners19.rar again..
13 years ago
PoisitionName is a probliem

so I use Banner.Id to control them. in my case, I put banner.ascx to ThreeColumn.master.

like these
<%@ Register TagPrefix="nopCommerce" TagName="Banner" Src="~/Modules/Banner.ascx" %>
...
...
<nopCommerce:Banner ID="Banners3C".......

and my PositionName were set to Banners3C
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.