blog.exotec

TYPO3 . XHTML/CSS . JavaScript/AJAX . iPhone/iOS

Mit Extbase die Tabelle Pages erweitern

extTables.sql

#
# Modifying pages table
#
CREATE TABLE pages (
check_in_out varchar(255) DEFAULT '' NOT NULL,
price varchar(255) DEFAULT '' NOT NULL,
persons int(11) unsigned DEFAULT '0' NOT NULL,
disabled_access tinyint(4) unsigned DEFAULT '0' NOT NULL,
children tinyint(4) unsigned DEFAULT '0' NOT NULL,
use_as_room tinyint(4) unsigned DEFAULT '0' NOT NULL,
dinner tinyint(4) unsigned DEFAULT '0' NOT NULL,
breakfast tinyint(4) unsigned DEFAULT '0' NOT NULL,
);

Configuration/TCA/Overrides/pages.php

< ?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
// Configure new fields:
$fields = array(
'check_in_out' => array(
‘label’ => ‘Buchungen’,
‘exclude’ => 1,
‘config’ => array(
‘type’ => ‘inline’,
‘foreign_table’ => ‘tx_accomodation_domain_model_dates’,
‘maxitems’ => 999,
‘appearance’ => array(
‘collapseAll’ => 1,
‘expandSingle’ => 1,
),
),
),
‘price’ => array(
‘exclude’ => 1,
‘label’ => ‘Preis’,
‘config’ => array(
‘type’ => ‘input’,
‘default’ => 0,
‘eval’ => ‘double2′
)
),
‘persons’ => array(
‘exclude’ => 1,
‘label’ => ‘Anzahl Personen’,
‘config’ => array(
‘type’ => ‘input’,
‘default’ => 0
)
),
‘children’ => array(
‘exclude’ => 1,
‘label’ => ‘Kinder’,
‘config’ => array(
‘type’ => ‘check’,
‘default’ => 0
)
),
‘disabled_access’ => array(
‘exclude’ => 1,
‘label’ => ‘Behindertengerecht’,
‘config’ => array(
‘type’ => ‘check’,
‘default’ => 0
)
),
‘use_as_room’ => array(
‘exclude’ => 1,
‘label’ => ‘Seite als Zimmer verwenden?’,
‘config’ => array(
‘type’ => ‘check’,
‘default’ => 0
)
),
‘breakfast’ => array(
‘exclude’ => 1,
‘label’ => ‘Frühstück’,
‘config’ => array(
‘type’ => ‘check’,
‘default’ => 0
)
),
‘dinner’ => array(
‘exclude’ => 1,
‘label’ => ‘Abendbrot’,
‘config’ => array(
‘type’ => ‘check’,
‘default’ => 0
)
),
);
// Add new fields to pages:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(’pages’, $fields);
// Make fields visible in the TCEforms:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
‘pages’, // Table name
‘–div–;Buchungskalender;accomodation’, // Field list to add
”, // List of specific types to add the field list to. (If empty, all type entries are affected)
” // Insert fields before (default) or after one, or replace a field
);
// Add the new palette:
$GLOBALS[’TCA’][’pages’][’palettes’][’accomodation’] = array(
’showitem’ => ‘use_as_room,–linebreak–,check_in_out,–linebreak–,price,persons,–linebreak–,disabled_access,children,dinner,breakfast,’
);

Kommentar schreiben:


83,946 Spam-Kommentare
blockiert von
Akismet