Chapter 7: Adding Extra Fields [Modifying component layout or template layout override]
Okay, what we do in this section is similar to what we did in the Component Override and Template Override section, previous. If you require a detailed explanation of the parameters passed to the inline plugin event, please see those sections for a full breakdown.
Now, all you to have to do is fire off the inline event passing in the field value you want to make inline editable. That is it.
In our case, we did the following for our, simple, Content Construction Kit:
<?php foreach ($this->item->fields as $field) : ?> <div class="mycck field-body field-margin"> <?php $dispatcher->trigger('editable',array(&$field->text, array('id'=>.$this->item->item_id.'_'.$field->field_id,'context'=>'mycck','itemtype'=>$field->type))); echo $field->text; ?> </div> <?php endforeach;?>
Note: Since we only have one extra field, we did no checks to check the field type in the above example.
Okay, we are not finished yet; Now, we have to add the functions to allow the editor to update or save our data during inline editing in the following section.