It looks like you're new here. If you want to get involved, click one of these buttons!
public $serialized_fields = array('content');
$fields['content'] = array(
'display_label' => false,
'add_extra' => FALSE,
'init_display' => 'all',
'dblclick' => 'toggle',
'repeatable' => TRUE,
'style' => 'width: 680px;',
'type' => 'template',
'label' => 'Content',
'title_field' => 'sections',
'fields' =>
array(
'sections' => array('type' => 'section', 'label' => 'Block <span class="num">{num}</span>'),
'block' => array('type' => 'block', 'folder' => 'landing', 'label' => 'Block')
)
);
Comments
$fields['content'] = array( 'type' => 'template', ... 'fields' => array( 'sections' => array('type' => 'section', 'label' => 'Block <span class="num">{num}</span>'), 'block' => array('type' => 'block', 'folder' => 'landing', 'label' => 'Block', 'module' => 'app') ) ...
So in My_fuel_layouts.php I have some defined Fuel_block_layouts that I can use in creating pages and it workes fine, I want to use those blocks in my simple module, when I create a new record in module I can see and use those blocks, when I save that record, data saves in database like JSON and it appears in view file but in admin page those bloks become empty...
However, if I set $model = 'news_model' in class Fuel_block_layout (fuel/libraries/Fuel_layouts.php line 1307) it worked!
Maybe I should define module somewhere else?
I use this in My_fuel_layouts.php:
$text_block = new Fuel_block_layout('news_item'); $text_block->set_model('news_model');
and it worked!
Please advise me what is the best way to use a single block layout in several modules?
So will have to produce blocks.