Customize the form view of a simple module

edited July 2015 in Modules
Hi,
I want to customize the opt-in generated view for creating/editing items.
I want to organize the form fields in tabstrips or the html fieldsets.

Is there a possibility to configure this?

Comments

  • edited 2:40AM
    There are a couple options for added fieldsets and sections to your forms using the field types of "fieldset" and "section":
    http://docs.getfuelcms.com/general/forms#fieldset
    http://docs.getfuelcms.com/general/forms#section
  • edited 2:40AM
    Hi,
    do you have an example how to add the subelements to the fieldset type?
  • edited 2:40AM
    Look at the fuel/application/config/MY_fuel_layouts.php file and then in that file the $config['layouts']['main'] array used to create the main layout fields.
  • edited 2:40AM
    I have now added some fieldsets to my module... but how can I set the form elements in relation to the fieldset? Now all my elements are at the top of the page and at the bottom there is the tabstrip with the fieldsets...
  • edited 2:40AM
    Hi,

    According to your comment with the main layout... That is for the frontend files, but I am in the backend side.
  • edited 2:40AM
    OK, got it. I forgot to add the order attribute to the fieldsets.
  • edited 2:40AM
    Hmmm and already the next question...
    perhaps just did not find it in the docs...
    I have an enum/select and I want to define a default value... but when I edit the entry the default should be overwritten with the database value.
    I did not achieve this so far...
  • edited 2:40AM
    Enums will look at the default value of an enum field if it is a brand new record for the initial value and select that. If you don't want a value at all that you specify the null parameter to be true like so:
    'null' => true,
  • edited August 2015
    Hi,

    next question for form view...
    How can I use the form builder to display 2 form fields in the same row with one label.

    So that as result I have something like:

    Datum, Uhrzeit (Beginn): "field1" "field2"
  • edited 2:40AM
    There are a few ways to do this:

    1. Use the "after_html" parameter on the field to create the additional HTML for the second field.
    $value = (isset($values['field2'])) ? $values['field2'] : ''; <code>$fields['my_field']['after_html'] = '<input type="text" value="'.$value.'">';
    2. Create a field of type custom that has a rendering callback function:
    http://docs.getfuelcms.com/general/forms#custom
    3. Create a custom field type (a little more involved):
    http://docs.getfuelcms.com/general/forms#association_parameters
  • edited 2:40AM
    hmmm ok... thought there would be a simpler way... both fields are database fields of the module... Think I will just put them each in one row... it's too bad because in one row it would look much better.
  • edited August 2015
Sign In or Register to comment.