<div class="field">
            <?php 
    echo $Form->label('addToTop', 'New items are');
    ?>
            <?php 
    $opts = array();
    $opts[] = array('label' => PerchLang::get('Added to the top'), 'value' => 1);
    $opts[] = array('label' => PerchLang::get('Added to the bottom'), 'value' => 0);
    echo $Form->select('addToTop', $opts, $Form->get($options, 'addToTop', 0));
    ?>
        </div>

        <?php 
    // Used by column_ids and sortField
    $Template = new PerchTemplate('content/' . $Region->regionTemplate(), 'content');
    $tags = $Template->find_all_tags('(content|categories)');
    ?>


        <div class="field last">
            <?php 
    echo $Form->label('column_ids', 'Item list column IDs');
    ?>
            <?php 
    echo $Form->text('column_ids', $Form->get($options, 'column_ids'), 'xl');
    echo $Form->hint(PerchLang::get('Enter field IDs to list when editing in list and detail mode. Comma separated.'));
    $suggestions = array();
    $suggestions[] = '_title';
    $seen_tags = array();
    if (PerchUtil::count($tags)) {
        foreach ($tags as $Tag) {
    }
}
/* --------- Edit Form ----------- */
if ($Region->regionTemplate() != '') {
    $Resources = new PerchResources();
    $Template = new PerchTemplate('content/' . $Region->regionTemplate(), 'content');
    if ($Template->status == 404) {
        $Alert->set('error', PerchLang::get('The template for this region (%s) cannot be found.', '<code>' . $Region->regionTemplate() . '</code>'));
    }
    $tags = $Template->find_all_tags_and_repeaters('content');
    //PerchUtil::debug($tags);
    $template_help_html = $Template->find_help();
    $Form = new PerchForm('edit');
    $req = array();
    // initialise field types (add head javascript)
    $all_tags = $Template->find_all_tags('content');
    if (PerchUtil::count($all_tags)) {
        foreach ($all_tags as $tag) {
            $FieldType = PerchFieldTypes::get($tag->type(), $Form, $tag, $all_tags);
        }
    }
    // Check for required content
    if (is_array($tags)) {
        foreach ($details as $item) {
            $id = $item['itemID'];
            PerchContent_Util::set_required_fields($Form, $id, $item, $tags, $Template);
        }
    }
    if ($Form->posted() && $Form->validate()) {
        // New rev
        $Region->create_new_revision();