Create Widget don't work

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

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

                // Attach the "ShoppingCartWidgetPart"

                // In order to turn this content type into a widget, it needs the 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

            return 4;

Code as,But, in the Administrator Dashboard can't choose.reference,please help me,Thank's

Oct 26, 2012 at 10:24 AM

Orchard CMS Version 1.6 RC

Oct 26, 2012 at 11:19 AM

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 2:04 AM

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

Oct 27, 2012 at 4:23 AM

Did you enable the feature?

Oct 27, 2012 at 12: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?