many similar tables

edited November 2013 in Modules
My database has 50+ lookup tables each with very similar fields. I'm wondering how best to expose these in Admin.

1. Create a simple module for each table. This would be the easiest method however it would make the Modules section of the left-hand Admin menu very long. Is there a way to display this menu as a tree view, categorising my Modules by purpose? ie:
- work module 1 module 2 - play module 3 module 4
2. Create an advanced module with an initial customised view showing the tree structure of tables (as above) from which I can then select a table to dive into and edit in the normal way (list view -> form view).

Any recommendations? Examples?

Thanks.
__croaker

Comments

  • edited 10:27AM
    You can customize the left hand menu to nest things under one area and it doesn't require it to be an advanced module. The default navigation menu setting is found in the fuel/modules/fuel/config/fuel.php file and can be overwritten in your fuel/application/config/MY_fuel.php file. Below is the default value:
    // site... Dashboard will always be there $config['nav']['site'] = array( 'dashboard' => lang('module_dashboard'), 'pages' => lang('module_pages'), 'blocks' => lang('module_blocks'), 'navigation' => lang('module_navigation'), 'tags' => lang('module_tags'), 'categories' => lang('module_categories'), 'assets' => lang('module_assets'), 'sitevariables' => lang('module_sitevariables') ); // my modules... if set to empty array, then it will automatically include all in MY_fuel_modules.php $config['nav']['modules'] = array(); // tools $config['nav']['tools'] = array(); // manage $config['nav']['manage'] = array( 'users' => lang('module_users'), 'permissions' => lang('module_permissions'), 'manage/cache' => lang('module_manage_cache'), 'logs' => lang('module_manage_activity'), 'settings' => lang('module_manage_settings'), );
    Note the the advanced blog module has a config file that does this however, as mentioned earlier, this doesn't have to be in an advanced module and can instead just be in the MY_fuel.php file.:
    /* |-------------------------------------------------------------------------- | FUEL NAVIGATION: An array of navigation items for the left menu |-------------------------------------------------------------------------- */ $config['nav']['blog'] = array( 'blog/posts' => lang('module_blog_posts'), 'blog/categories' => lang('module_blog_categories'), 'blog/comments' => lang('module_blog_comments'), 'blog/links' => lang('module_blog_links'), 'blog/users' => lang('module_blog_authors'), );
    However, if you are needing to expose 50+ modules, then I don't think stuffing them in the left menu would really work. You could perhaps even create another simple module that simply lists all the other modules, and you could use the built in tree view functionality to help with the navigation. For the row actions in the list view, you could simply remove the DELETE and EDIT just have the VIEW which would take you to the model. This can be done by editing the modules "table_actions" parameter (http://docs.getfuelcms.com/modules/simple). The VIEW button displays only if you enter in a preview_path value for your module (e.g. 'preview_path' => 'fuel/{module}/'. Does that make any sense?

    Also, in the 1.0 beta there are is a fuel_relationships model built in to take care of having to use a bunch of lookup tables. It also does a lot of the work for mapping data to your models already. More documentation can be found here:
    http://docs.getfuelcms.com/general/models#relationships
Sign In or Register to comment.