This project is read-only.

How to add a configuration page on the admin portal and pass parameters into a custom module?

Topics: Core, Writing modules
Mar 1, 2013 at 3:02 PM

I'd like to add a configuration page on the admin dashboard, see picture above.
So the three parameters can be used in my custom module.

Does anyone has a 'tutorial' of how to do that?

Mar 1, 2013 at 9:51 PM
There's no tutorial yet as far as I know, but meanwhile you can have a look at how Orchard.Users is doing it. Look at RegistrationSettings* classes.
Mar 2, 2013 at 9:47 AM
Here is some good documentation on the subject.
Mar 2, 2013 at 4:49 PM
Thanks but the article isn't very clear.
I assume I should use the site scope instead of content type scope?
Needs some advise or a simple and clear instruction. :(
Mar 2, 2013 at 6:59 PM
Perhaps you should try and follow along with the article and come back here with concrete blockers / questions. That way we can help out better. There's currently no other article as far as I know.
Mar 2, 2013 at 7:01 PM
In any case, keep in mind that site settings are no different from regular content parts. You simply define your own content part which gets attached to the Site content item. Some additional actions can be taken to neatly group your custom settings underneath the Settings section in the dashboard menu.
Mar 3, 2013 at 9:34 AM
Thanks Sfmskywalker,

In my case, I just use these three parameters within my custom module, not sharing with other modules.
So should I choose the site scope or content type scope? - I'm a bit confused by looking at the article.
Mar 3, 2013 at 11:06 AM
If you want settings that are global for the site, use the instructions for the site scope. If you need settings per content type, follow the content type scope.
Mar 5, 2013 at 3:20 PM
Thanks guys.
The site scope works; however it only add my parameters within the Settings->General tab;
How can I add my parameters into a new tab (call: "My Module Settings")?
Mar 5, 2013 at 3:45 PM
Using Grouping. Essentially, if you are using your own driver, chain the OnGroup method call on the ContentShape method. If you're using the TemplateFilterForRecord<T>, be sure to pass in a group name.

In your content handler, implement the OnGetContentItemMetadata<TPart> method (or override GetItemMetadata method as is done in Orchard.Users) and set the add a GroupInfo to the Metadata.EditorGroupInfo collection.

That should be it.
Mar 5, 2013 at 9:13 PM
Sorry I don't understand - do you have an example by any chance? Thanks!
Mar 7, 2013 at 12:49 AM
I will have one in a couple of days.
Mar 12, 2013 at 10:22 AM
Hi sfmskywalker,

Looking forward to see your input. :)
Mar 13, 2013 at 1:21 AM