This project is read-only.

Use module, widget or theme

Topics: Customizing Orchard
Feb 19, 2011 at 4:12 AM

I want to add a link "registry" in the header of each front-end page so everyone can registy by himself directly like most of blogs or forums.

But I am confused on the following issues:

1. Which approach I should adapt? I've tried to customize theme by override the view layout.cshtml, it works but I  don't think it's elegant. There are widget seems just designed to do this kind of stuff, but it must based on ContentPart and data migration? What I want is just adding a link, need so complex? And how about module? ......

2. Can I reuse the "User" module? And how?

I know it's a big question, so even only a thought is helpful very much! And thanks in advance.

Feb 19, 2011 at 5:15 AM

You can create a widget without creating a part. Create a simple migration that just creates the widget type. It should be super-simple, it seems like you just need to name it and make it a widget but it won't have any data, right? You can then write the template for it and you're done. As for a module, sure, but a module is just a container: you would just put the code for that widget in a module.

As for reusing the user module, I don't understand what you mean by that. Can you explain what your scenario is?

Feb 19, 2011 at 5:48 AM

Thanks, bertrandleroy.

The original Orchard can only add a user in the dashboard and only login user can enter the dashboard. So those annoymous user can’t regestry themselves. I want to customize it to let any user can registy themselves by click the “registry” link at front end pages, which is common in many blogs or forum websites.

And because there has been a User module who provide the facility of “add user”, so I am wondering if I can make use of it to save my code.

Feb 19, 2011 at 5:54 AM

You don't need to develop that feature as it's already there. Go into settings and look under user registration.

Feb 19, 2011 at 6:08 AM


Yes, here is it. Wonderful! Thanks very much!