Adding a field to the main layout (v1)
  • Hi,

    I added a field to "main" in MY_Fuel_layouts called "sub_content". So in the config for main, in the fields array I have:

    'Sub_content' => array('label' => 'Sub content', 'type' => 'textarea', 'class' => 'no_editor', 'order' => 9)

    This appears fine in the admin, and raw html data is saved in the fuel_page_variables table.

    In my main.php layout view file, I have:

    <?php echo fuel_var('sub_content', '<!-- No sub content -->'); ?>

    This places the inline edit span, but does not render the data in the field. What am I doing wrong?!
  • GAH! The variable is case sensitive! Should have been

    <?php echo fuel_var('Sub_content'); ?>

    or alternatively rename the variable!

    I was being thicker than a whale omelette!

    Incidentally, do the docs have a comprehensive breakdown of the parameters available for the layout fields? Or are they just the same as those for Form Builder?
  • They are the same as what's used for Form_builder.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!