Hallo,
ich weiß zu diesem Thema gibt es schon einige Threads.
Hier gleich mal eine Liste:
#10193
http://www.typo3faq.net/index.php?aktion=artikel&rubrik=003&id=57&lang=de
#14216
Leider bekomme ich meine zusätzlichen Felder nicht in tt_address eingetragen.
Hier was ich bisher getan habe:
1. Mein Newsletter Template folgendermaßen angepasst:
<!-- ###TEMPLATE_CREATE### begin
Form for creation of a new newsletter recipient
-->
<form name="tt_address_form" method="post" action="###FORM_URL###">
###GW1B###<h1>NEWSLETTER</h1>
<h2>IMMER AUF DEM AKTUELLEN STAND</h2>
<p>Abonnieren Sie den Newsletter und Sie erhalten monatlich aktuelle Informationen.</p>
<h2>MELDEN SIE SICH JETZT AN</h2>
###GW1E###
<br>
<br>
###GW2B###
<fieldset>
<p><label for="FE[tt_address][gender]">Anrede:</label><input type="radio" id="FE[tt_address][gender]" name="FE[tt_address][gender]" value="Herr" checked>Herr <input type="radio" name="anrede" id="anrede" value="Frau">Frau</p>
<p><label for="FE[tt_address][title]">Titel:</label><input type="text" name="FE[tt_address][title]" id="FE[tt_address][title]" maxlength="50"></p>
<p><label for="FE[tt_address][firstname]">Vorname:</label><input type="text" name="FE[tt_address][firstname]" id="FE[tt_address][firstname]" maxlength="50"></p>
<p><label for="FE[tt_address][name]">Name:</label><input type="text" name="FE[tt_address][name]" id="FE[tt_address][name]" maxlength="50"></p>
<p><label for="FE[tt_address][position]">Funktion:</label><input type="text" name="FE[tt_address][position]" id="FE[tt_address][position]" maxlength="50"></p>
<p><label for="FE[tt_address][company]">Firma:</label><input type="text" name="FE[tt_address][company]]" id="FE[tt_address][company]]" maxlength="50"></p>
<p><label for="FE[tt_address][email]">E-Mail<span class="orange">*</span>:</label><input type="text" name="FE[tt_address][email]" id="FE[tt_address][email]" maxlength="50"></p>
<p><label for="FE[tt_address][module_sys_dmail_html]">HTML E-Mails:</label><input type="checkbox" name="FE[tt_address][module_sys_dmail_html]" id="FE[tt_address][module_sys_dmail_html]" value="1"></p>
</fieldset>
<p><input type="submit" name="whatever" value="ANMELDEN" class="button"></p>
###HIDDENFIELDS###
</form>
<p>Wenn Sie schon angemeldet sind, können Sie <a href="###FORM_URL###&cmd=infomail&backURL=###FORM_URL_ENC###">hier Ihre Daten ändern oder sich abmelden</a>.</p>
###GW2E###
<!-- ###TEMPLATE_CREATE### end-->
2. Die entsprechenden Felder in der tt_address angelegt (über phpMyAdmin)
3. Die Datei tca.php folgendermaßen angepasst:
<?php
// ******************************************************************
// This is the standard TypoScript address table, tt_address
// ******************************************************************
$TCA['tt_address'] = Array (
'ctrl' => $TCA['tt_address']['ctrl'],
'interface' => Array (
'showRecordFieldList' => 'name,address,city,zip,country,phone,fax,email,www,title,company,image'
),
'feInterface' => $TCA['tt_address']['feInterface'],
'columns' => Array (
'hidden' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.hidden',
'config' => Array (
'type' => 'check'
)
),
'gender' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.gender',
'config' => Array (
'type' => 'input',
'size' => '10',
'max' => '5'
)
),
'firstname' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.firstname',
'config' => Array (
'type' => 'input',
'size' => '20',
'max' => '256'
)
),
'name' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.name',
'config' => Array (
'type' => 'input',
'size' => '20',
'max' => '256'
)
),
'title' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.title',
'config' => Array (
'type' => 'input',
'size' => '20',
'eval' => 'trim',
'max' => '40'
)
),
'position' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.position',
'config' => Array (
'type' => 'input',
'size' => '40',
'max' => '256'
)
),
'address' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.address',
'config' => Array (
'type' => 'text',
'cols' => '20',
'rows' => '3'
)
),
'phone' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.phone',
'config' => Array (
'type' => 'input',
'eval' => 'trim',
'size' => '20',
'max' => '30'
)
),
'fax' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.fax',
'config' => Array (
'type' => 'input',
'size' => '20',
'eval' => 'trim',
'max' => '30'
)
),
'mobile' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:tt_address/locallang_tca.php:tt_address.mobile',
'config' => Array (
'type' => 'input',
'eval' => 'trim',
'size' => '20',
'max' => '30'
)
),
'www' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.www',
'config' => Array (
'type' => 'input',
'eval' => 'trim',
'size' => '20',
'max' => '80'
)
),
'email' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.email',
'config' => Array (
'type' => 'input',
'size' => '40',
'eval' => 'trim',
'max' => '80'
)
),
'company' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.company',
'config' => Array (
'type' => 'input',
'eval' => 'trim',
'size' => '20',
'max' => '80'
)
),
'city' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.city',
'config' => Array (
'type' => 'input',
'size' => '20',
'eval' => 'trim',
'max' => '80'
)
),
'zip' => Array (
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.zip',
'config' => Array (
'type' => 'input',
'eval' => 'trim',
'size' => '10',
'max' => '20'
)
),
'country' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.country',
'config' => Array (
'type' => 'input',
'size' => '20',
'eval' => 'trim',
'max' => '30'
)
),
'image' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.image',
'config' => Array (
'type' => 'group',
'internal_type' => 'file',
'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
'max_size' => '1000',
'uploadfolder' => 'uploads/pics',
'show_thumbs' => '1',
'size' => '3',
'maxitems' => '6',
'minitems' => '0'
)
),
'description' => Array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.php:LGL.description',
'config' => Array (
'type' => 'text',
'rows' => 5,
'cols' => 48
)
)
),
'types' => Array (
'1' => Array('showitem' => 'hidden;;;;1-1-1, name;;2;;3-3-3, company;;6, address;;3, email;;5, phone;;4, image;;;;4-4-4, description')
),
'palettes' => Array (
'2' => Array('showitem' => 'gender, title, firstname'),
'3' => Array('showitem' => 'zip, city, country'),
'4' => Array('showitem' => 'mobile, fax'),
'5' => Array('showitem' => 'www'),
'6' => Array('showitem' => 'position'),
)
);
?>
4. Sprache in locallang_general.xml um neue Begriffe erweitert
5. ext_tables.php um neue Felder erweitert:
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$TCA['tt_address'] = Array (
'ctrl' => Array (
'label' => 'name',
'label_alt' => 'email',
'default_sortby' => 'ORDER BY name',
'tstamp' => 'tstamp',
'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
'delete' => 'deleted',
'title' => 'LLL:EXT:tt_address/locallang_tca.php:tt_address',
'enablecolumns' => Array (
'disabled' => 'hidden'
),
'thumbnail' => 'image',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'ext_icon.gif',
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php'
),
'feInterface' => Array (
'fe_admin_fieldList' => 'pid,hidden,name,firstname,gender,title,address,phone,fax,mobile,www,email,city,zip,company,position,country,description'
)
);
t3lib_extMgm::addPlugin(Array('LLL:EXT:tt_address/locallang_tca.php:pi_tt_address', '0'));
t3lib_extMgm::allowTableOnStandardPages('tt_address');
t3lib_extMgm::addToInsertRecords('tt_address');
t3lib_extMgm::addLLrefForTCAdescr('tt_address','EXT:tt_address/locallang_csh_ttaddr.php');
?>
6. ext_tables.sql um neue Felder erweitert, was allerdings bestimmt nicht nötig gewesen wäre, da ich die Felder in der DB ja schon von Hand angelegt hatte.
Das alles hat zur Folge, dass meine Anmeldemaske genauso aussihet wie ich will. Auch im Backend ist die Ansicht der einzelnen Empfänger perfekt.
Nur: es werden immer nur wie vor meiner Erweiterung Name, Email und HTML/nichtHTML in die DB gespeichert ;o(.
Woran kann das liegen?
Gruß,
Claudia