Creating a Module in a text editor or VS2010

Topics: General
Apr 23, 2011 at 9:45 AM

I just want to know why the article "Writing an Orchard Module" (which used Visual Studio) was replaced with the article "Creating a Module Using a Text Editor"

Surely if you're creating a Module, you'd be best off using Visual Studio?

Its all very confusing.

I want to use Orchard to handle the information pages in my site but I also want to make use of my existing code for certain other areas of the site. I understand that I can move these areas in their own MVC "Area" and add a manifest to turn them into a Module. If I did this I'd need to open the site in Visual Studio to continue editing my own code.

However, I've read that it is not recommended to open the downloaded Orchard Site in VS2010 but rather download the entire source code and project.

Seems weird that I would have to download and work with the entire source of Orchard just to be able to work on my own "non-Orchard" code.

I must be missing something here.

Apr 23, 2011 at 11:50 AM

I think the text editor tutorial is just to demonstrate that you can. There's still the old http://www.orchardproject.net/docs/Building-a-hello-world-module.ashx which doesn't particularly demonstrate any editor.

Using a full source enlistment is recommended if you're doing anything complicated and might need to debug, and sometimes dig into the source code to understand what's going on. But you don't actually need it.

Apr 23, 2011 at 9:26 PM

Hi Pete

I downloaded  Orchard.Web.1.1.30 and opened the project in VS20110. I copied the required DLLs into a Library folder and then referenced them as certain files in the "bin" directory were deleted at build time.

I get the Orchard setup screen but after I've put in all the required information I get:

Setup failed:
The specified table already exists. [ Orchard_Framework_DataMigrationRecord ]
I specified "Use built-in data storage (SQL Server Compact)"

Any ideas on how to sort this?

Stephen

Apr 23, 2011 at 9:47 PM

You shouldn't have to copy any DLL files, the build process puts them wherever they're needed.

Consequently perhaps you've ended up effectively with duplicate modules so the migrations are running twice, could explain the error. Just delete your Library folder, App_Data/Sites, and cache and hrestart; then run setup again.

Apr 23, 2011 at 10:09 PM

Hi Pete,

I got the site up and running and have now created some content.

I was trying to work out how to create sub pages of a content page but came to the conclusion that you cant actually visualise a hierarchy within the CMS. You have to install the Advanced Menu module to create the appearance of a hierarchy.

How do I go about installing that module when I'm running Orchard from VS2010.

Apr 23, 2011 at 10:22 PM

Well you can use ContainerPart / ContainablePart to create hierarchies with sub URLs. That's the default way.

Advanced menu lets you create additional hierarchies for navigation, as you say it's just an appearance, kind of a meta-hierarchy.

You install the module the same way you always do. Thru the Modules > Gallery admin, or just by copying it into the modules folder. Why would running from VS be any different to normal operation?

Apr 23, 2011 at 10:36 PM

Hi Pete

Sorry, was confusing myself regarding the modules. Its getting late here so I will come back to this in the morning.

Thanks for your help.

G