Inline Edit inside a block (v1.0)

edited July 2013 in Feature Requests
I have a layout that includes a template field, the template includes a block field. The block is custom defined with a few fields and has an accompanying view file. All this works and I can add a call to fuel_edit to the page layout file and edit the whole lot. I would rather be able to add fuel_edit to the block itself and edit the fields within the block - is this possible?

Comments

  • edited 5:33PM
    When you say "edit the fields within the block", do you mean editing the "name" and "view" fields of the actual block from the CMS or editing the layout variable fields that get applied to that block that you set in your MY_fuel_layouts.php file? If you want to edit the layout variable fields, you can use fuel_edit('field_name'), with "field_name" being the variable set in the layout.
  • edited 5:33PM
    I have a working example where I just have a template field with three block fields and I can add fuel_edit for the template (i.e. letting me select which blocks to use) and then I call fuel_block for each of the three block fields and that automatically adds the inline edit for the content of each block.

    My more complex example which I can't figure out is a template field that is repeatable. The template has a single field, a block. I can add an edit for the whole thing in the layout file with fuel_edit('template_field_name').

    I then have a foreach loop with the following code...

    <?php foreach($full_width_blocks as $full_width_block) :
    $block_name = $full_width_block['block']['block_name'];
    if (!empty($block_name)) : ?>
    <?=fuel_block('full-width/'.$block_name, $full_width_block['block']) ?>
    <?php endif; ?>
    <?php endforeach; ?>

    This use of fuel_block does not create me an inline edit link.

    I assume this is because I am specifying the view file and I need to add a link in there but I can't work out what.

    Thanks!
  • edited 5:33PM
    I think I understand. Because the template field is stored as one serialized array variable, when you edit using fuel_edit you have to edit the whole thing so unfortunately, there isn't a way right now to just edit a single block if you are using a repeatable field.
  • edited 5:33PM
    Ah ok, well the higher-level edit is pretty good anyway !

    Thanks for your help.
Sign In or Register to comment.