Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – creating the editing interface


Carry out the following steps:

  1. As adding and editing a block is pretty much the same, we're going to create a file named form_setup_html.php, which is shared by both add.php and edit.php.

  2. First, let's create add.php and edit.php; both are rather simple and identical because everything is located in form_setup_html.php:

    <?php 
    defined('C5_EXECUTE') or die(_("Access Denied."));
    $this->inc('form_setup_html.php'); 
    ?>
  3. In a new file form_setup_html.php, save the following content:

    <?php
    defined('C5_EXECUTE') or die(_("Access Denied."));
    
    $al = Loader::helper('concrete/asset_library');
    
    echo '<div class="ccm-block-field-group">';
    echo '<h2>' . t('Title') . '</h2>';
    echo $form->text('title', $title, array('style' => 'width: 550px'));
    echo '</div>';
    
    echo '<div class="ccm-block-field-group">';
    echo '<h2>' . t('Picture') . '</h2>';
    echo $al->image('ccm-b-image', 'fIDpicture', t('Choose File...