Displaying a Block in edit mode
Permalink
            I have a form that I want to display a block in edit mode on. I can display a blocktype in add mode but I cannot display the block or blocktype in edit mode.
Displays fine.
Errors out with:
'Call to a member function getBlockID() on a non-object'
'<a name="_edit<?php echo $b->getBlockID()?>"></a>'
I know I am missing something.
    $bt = BlockType::getByHandle('video_player'); $bt->render('add');
Displays fine.
$bt = BlockType::getByHandle('video_player'); $bt->render('edit');
Errors out with:
'Call to a member function getBlockID() on a non-object'
'<a name="_edit<?php echo $b->getBlockID()?>"></a>'
I know I am missing something.
                        I have tried but I cannot figure out how to display the edit view from the block and not the blocktype. The block itself with values does not have render so what do I use?                    
                
                        The block itself doesn't have a render function but it has a display function with a view type as an argument just like render                    
                
                        When you use display it runs the following code try and build out the block form which errors out on $dialogController because it does not exist. I also do not need the block form at all.
                    
                <form method="post" id="ccm-block-form" class="validate" action="<?php echo $dialogController->action('submit')?>" enctype="multipart/form-data">
                        Any ideas?                    
                

 
                    
What you have is a block type object so it's a generic one, not a specific one with a block ID so I don't think you can have it in edit mode. Edit mode means edit existing values but in your case there are no existing values.