Repeatable block not returned saved values

edited May 2017 in Modules
Hi I have created a model and in the form_fields() method I have the following code

$fields['sections'] = array(
'type' => 'template',
'display_label' => FALSE,
'label' => 'Page sections',
'add_extra' => FALSE,
'repeatable' => TRUE,
'title_field' => "block",
'init_display' => 'first',
'dblclick' => 'toggle',
'order' => 210,
'fields' => array(
'sections' => array('type' => 'section', 'value' => '{__title__}'),
'block' => array('type' => 'block', 'folder' => 'blog'),
),
);

The code works and I am able to select different templates and fill in the data an it is saved to the sections field in the database table in a serialised format, however it is not pulling the data back for the block fields. Any ideas what maybe causing the issue?

Comments

  • edited 7:43AM
    In your fuel/application/config/MY_fuel_layouts.php file, try adding the 'model' parameter to the following parameter to the block layout configuration array:
    $config['blocks']['my_block_layout'] = array( ... 'model' => 'my_model', ... );
  • edited 7:43AM
    Cheers, added the line $header->set_model('post_model'); to every block in the layouts file
Sign In or Register to comment.