Custom Module CRUD within Admin Tabbed Views?

Topics: General, Writing modules
Oct 11, 2012 at 2:34 AM

Hi all *please forgive my poor coding knowledge* - first of all I have a custom module that includes:

-handler,
-part model,
-partrecord,
-migration file,
-driver,
-and a view that resides in the EditorTemplates/Parts folders called ‘settings’.

The module functions as expected to simply attach a table to the db with six simple strings that I can edit from the dashboard.

Now I wish to update this module and add to these settings whilst giving it a bit more order by changing the modules admin layout to include tabs:

AdminMenu.cs

public void GetNavigation(NavigationBuilder builder) {
            builder.AddImageSet("settings")
                .Add(T("Settings"), "99", menu => menu.Add(T("Test"), "0", item => item.Action("Index", "Admin", new { area = "EA" }).Permission(StandardPermissions.SiteOwner)//, new[] { "collapsed" });
                    .Add(T("Settings"), "1.0", i => i.Action("Index", "Admin", new { area = "EA" }).LocalNav())  //Permission(Permissions.ManageFeatures)
                    .Add(T("Buttons"), "1.1", i => i.Action("Index", "Admin", new { area = "EA" }).Permission(StandardPermissions.SiteOwner).LocalNav())));
        }

Again, this is fine and what I want; however, when it comes to displaying/editing the data in the individual tabs – I’m a little perplexed as to the correct way I should go about it. Should I create a controller for each tab section with edit actions and appropriate viewmodels [exactly the same as my partrecord model], or is there a more correct approach that utilizes inbuilt ‘orchard’ functions? Thanks for your thoughts, Kyd

Coordinator
Oct 11, 2012 at 2:40 AM

No, for CRUD, that sounds fine.

Oct 11, 2012 at 3:04 AM

Thanks for the peace of mind Bertrand, Kyd.