Custom admin template

edited March 2014 in Share
Hi,

I have made a module 'webcast', which has a model 'events'. At the moment it uses the form_builder to allow the admin to enter in basic data. But I need to do a more advanced form, which I don't think I can do with form_builder.

So my question is, how would I go about creating my own custom template with in the normal admin interface?
When I visit '/admin/webcast/events/edit' it shows the standard form, how do I override this controller/view?

Where would I put this?
$this->fuel->admin->render('admin_events', $vars, Fuel_admin::DISPLAY_NO_ACTION, 'webcast'); ?

Hope this makes sense! Cheers

Comments

  • edited 10:20PM
    You can create a controller that extends the fuel/modules/fuel/controllers/module.php controller and overwrite methods like the "form" method. You would need to create a route that would direct people to that page:

    $route[FUEL_ROUTE.'webcast/events'] = 'webcast/events'; $route[FUEL_ROUTE.'webcast/events/(.*)'] = webcast/events/$1';
    You'll need to add the following parameter to your events module configuration:
    'module_uri' => 'webcast/events'',

    However, Form_builder is pretty powerful and allows you to create custom fields as well as pass in templates for your form fields. Check out the "custom" and "template" field type in particular. The template field type you can pass it a "view" parameter and it passes a $fields array to that view where you can use to insert your fields.
    http://docs.getfuelcms.com/general/forms#template
    http://docs.getfuelcms.com/general/forms#custom

    If you need to add specific javascript to your form fields, there are several ways to do it:
    http://docs.getfuelcms.com/general/javascript
Sign In or Register to comment.