I thought I'd try out the Block layout feature of Fuel as outlined here:
http://docs.getfuelcms.com/general/layoutsCopying the code verbatim, I get 2 PHP errors in the view :
Message: Undefined variable: sections,
Message: Invalid argument supplied for foreach()
and the admin edit/create page shows nothing much for a page saved with the Test layout except:
Layout Variables
This is the test layout field.
Should there be something there? The block file "image_right.php" is in _blocks/sections/ so I think it should at least show that as an option?
Comments
$test_layout->add_fields($test_fields);
http://docs.getfuelcms.com/general/layouts
Fatal error: Cannot use object of type Fuel_block_layout as array in .../Fuel_layouts.php on line 162
This is an exciting feature!
$config['blocks']['test'] = array( 'group' => 'Sections', 'label' => 'Two Column', 'fields' => array( 'two_column' => array( 'display_label' => FALSE, 'type' => 'template', 'fields' => array( 'url' => array('type' => 'link', 'label' => 'Link'), 'image' => array('type' => 'asset', 'folder' => 'images', 'multiple' => FALSE), 'content' => array('type' => 'textarea') ), 'class' => 'repeatable', 'add_extra' => FALSE, 'repeatable' => TRUE ) ) );
This is one of my favorite new features. Makes FUEL very flexible and fast for setting up page layouts. Has saved us a ton of development time when creating new sites.
I was wondering though, instead of specifying the fields for the block, are we able to specify a model and have it pull the fields from there?