Create Widget don't work

Topics: Writing modules
Oct 26, 2012 at 11:24 AM
        public int UpdateFrom2()
        {

            // Define a new content type called "ShoppingCartWidget"
            ContentDefinitionManager.AlterTypeDefinition("ShoppingCartWidget", type => type

                // Attach the "ShoppingCartWidgetPart"
                .WithPart("ShoppingCartWidgetPart")

                // In order to turn this content type into a widget, it needs the WidgetPart
                .WithPart("WidgetPart")

                // It also needs a setting called "Stereotype" to be set to "Widget"
                .WithSetting("Stereotype", "Widget")
                );

            return 3;
        }

        public int UpdateFrom3()
        {
            // Update the ShoppingCartWidget so that it has a CommonPart attached, which is required for widgets (it's generally a good idea to have this part attached)
            ContentDefinitionManager.AlterTypeDefinition("ShoppingCartWidget", type => type
                .WithPart("CommonPart")
            );

            return 4;
        }

Code as,But, in the Administrator Dashboard can't choose.reference http://skywalkersoftwaredevelopment.net/blog/writing-an-orchard-webshop-module-from-scratch-part-7,please help me,Thank's

Oct 26, 2012 at 11:24 AM

Orchard CMS Version 1.6 RC

Oct 26, 2012 at 12:19 PM

What do you mean, you can't choose reference in the dashboard? And how is the code above related to your problem??

Are you trying to write the webshop module from scratch, or did you try the source code provided in the guide?

Oct 27, 2012 at 3:04 AM

same code,same operate,can't choose ShoppingCartWidget in the dashboard(Widgets)

Coordinator
Oct 27, 2012 at 5:23 AM

Did you enable the feature?

Oct 27, 2012 at 1:46 PM

It should be listed (if you have enabled the feature) when adding a new widget. Does the widget appear under your content types?