Write a Orchard online store module from scratch (3)-Create a Orchard.webshop module project

Source: Internet
Author: User

Original address: Http://skywalkersoftwaredevelopment.net/blog/writing-an-orchard-webshop-module-from-scratch-part-3
Create a Orchard.webshop module project

This is the 3rd chapter of the tutorial on writing a new orchard module from scratch.
For an overview of this tutorial, please see the introduction.

The Orchard module is a true area class library of ASP. NET MVC, while following the specific specifications of ASP. NET MVC and Orchard.
The Orchard specification enhances your ASP. NET MVC area, so it can be integrated into the Orchard.

Now, we can use the Orchard command-line application to generate a basic structure for us, but let's start from scratch with Visual Studio, which allows us to fully understand that a module can be simply an empty class library plus a module.txt file as a module manifest.

Finally, our module will include:

    • A Module Manifest
    • Models & ViewModels
    • Views
    • Controllers
    • Drivers
    • Service classes
    • Handlers
    • Shapes
    • Javascript
    • Css
    • A Migration
    • A Resourcemanifest
    • Routes
    • Helpers methods


We will discuss each item in the process.
First, we will start by simply creating a new class library project.

In Visual Studio, create a new class library project under the Solution folder for the module, and make sure that the project is in the physical location \src\orchard.web\moduels:


Orchard requires that your module be located in the modules directory where the physical location exists.
Next, we will create the module's manifest file, which is a simple text file that explains our modules, such as the name of our module, description, version number, company URL, etc.

Let's start by entering the following information for Module.txt:

Name:Orchard.WebShop
Antiforgery:enabled
Author:sipke Schoorstra
Website:http://skywalkersoftwaredevelopment.net
version:1.0
orchardversion:1.3.10
Description:orchard webshop Module Demo
Category:webshop



Then we have a basic orchard module, but it doesn't have any function.
But that's what we're going to do next.

Let us confirm that Orchard has identified our module. Press CTRL + F5 to start the Web site.
After the site starts, navigate to the Administration page.

You can go directly to the admin page by typing the URL http://localhost:30320/OrchardLocal/admin, or click on the "Dashboard" link on the footer of the website.
Once in the Admin page, select modules to enable our orchard Webshop Module:



So we create a skeleton of a module! Next, let's make it possible to do something useful.

What we want is to enable administrators to define a variety of products: books, CDs, DVDs, mobile phones, etc.
All of these products have at least two common features: one unit price and one SKU attribute.

At the heart of Orchard, each part is actually made up of content parts.

For example, an administrator can define a new content type:
Book. The content type of book is defined by its contents parts.
The administrator can pick the content Parts he likes, such as: Bodypart,commentspart,routepart, etc.

In order for book to become a product, we need to first create our own custom part (section): Productpart.

Write a Orchard online store module from scratch (3)-Create a Orchard.webshop module project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.