Zum Inhalt springen

Neues Eingabefeld hinzufügen

Erstellt am 7. Januar 2005 · 3 Antworten · letzte Antwort am 7. Januar 2005

Tags: TCA, Frage

typonoob ·

Hallo Forum,

ich möchte zu meiner Extension gerne ein weiteres Eingabefeld (Checkbox) hinzufügen. Wo muss ich denn überall änderungen machen damit mir das Feld auch angezeigt wird?
Ich habe in der tca.php oben im bereich "interface" den namen hinzugefügt, habe in "columns" einen Block eingefügt und habe unten unter "types" meinen feldname hinzugefügt. ABER ES FUNKTIONIERT NICHT. Was habe ich vergessen? Worauf muss man achten?

jwitt ·

Das müßte ausreichen um eine Checkbox zu erstellen.
Vielleicht ein Syntaxfehler
Simples Beispiel:

"meineCheckbox" => Array (		
			"label" =>  "meinLabel",	
			"config" => Array (
				"type" => "check",
				"default" => "0"
			)
		),

Gruß
Jens

typonoob ·

Ich kriege es nicht zum laufen. Ich habe mir jetzt mit dem Kickstarter eine neue Extension gemacht und darin eine Checkbox angelegt, selbst wenn ich diesen code in meine alte Extension einbaue (sollte ja eigentlich richtig sein) bekomme ich keine neue Checkbox. Auch der Kickstarter (da kann man sich ja auch bestehende Extesnion zumindest ansehen erkennt das Feld nicht).

Das Feld was ich hinzufügen will ist das "imgresized" und mein tca.php sieht so aus:

<?php
if (!defined ("TYPO3_MODE")) 	die ("Access denied.");

$TCA["tx_2coltable_inhalte"] = Array (
	"ctrl" => $TCA["tx_2coltable_inhalte"]["ctrl"],
	"interface" => Array (
		"showRecordFieldList" => "hidden,starttime,endtime,fe_group,valign,ausrichtung,breite,ueberschrift,text,image,linkname1,link1,linkname2,link2,linkname3,link3,linkname4,link4,imgresized"
	),
	"feInterface" => $TCA["tx_2coltable_inhalte"]["feInterface"],
	"columns" => Array (
		"hidden" => Array (		
			"exclude" => 1,	
			"label" => "LLL:EXT:lang/locallang_general.php:LGL.hidden",
			"config" => Array (
				"type" => "check",
				"default" => "0"
			)
		),
		"starttime" => Array (		
			"exclude" => 1,	
			"label" => "LLL:EXT:lang/locallang_general.php:LGL.starttime",
			"config" => Array (
				"type" => "input",
				"size" => "8",
				"max" => "20",
				"eval" => "date",
				"default" => "0",
				"checkbox" => "0"
			)
		),
		"endtime" => Array (		
			"exclude" => 1,	
			"label" => "LLL:EXT:lang/locallang_general.php:LGL.endtime",
			"config" => Array (
				"type" => "input",
				"size" => "8",
				"max" => "20",
				"eval" => "date",
				"checkbox" => "0",
				"default" => "0",
				"range" => Array (
					"upper" => mktime(0,0,0,12,31,2020),
					"lower" => mktime(0,0,0,date("m")-1,date("d"),date("Y"))
				)
			)
		),
		"fe_group" => Array (		
			"exclude" => 1,	
			"label" => "LLL:EXT:lang/locallang_general.php:LGL.fe_group",
			"config" => Array (
				"type" => "select",	
				"items" => Array (
					Array("", 0),
					Array("LLL:EXT:lang/locallang_general.php:LGL.hide_at_login", -1),
					Array("LLL:EXT:lang/locallang_general.php:LGL.any_login", -2),
					Array("LLL:EXT:lang/locallang_general.php:LGL.usergroups", "--div--")
				),
				"foreign_table" => "fe_groups"
			)
		),
		"valign" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.valign",		
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.valign.I.0", "0", t3lib_extMgm::extRelPath("2coltable")."selicon_tx_2coltable_inhalte_valign_0.gif"),
					Array("LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.valign.I.1", "1", t3lib_extMgm::extRelPath("2coltable")."selicon_tx_2coltable_inhalte_valign_1.gif"),
					Array("LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.valign.I.2", "2", t3lib_extMgm::extRelPath("2coltable")."selicon_tx_2coltable_inhalte_valign_2.gif"),
				),
				"size" => 1,	
				"maxitems" => 1,
			)
		),
		"ausrichtung" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.ausrichtung",		
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.ausrichtung.I.0", "0", t3lib_extMgm::extRelPath("2coltable")."selicon_tx_2coltable_inhalte_ausrichtung_0.gif"),
					Array("LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.ausrichtung.I.1", "1", t3lib_extMgm::extRelPath("2coltable")."selicon_tx_2coltable_inhalte_ausrichtung_1.gif"),
					Array("LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.ausrichtung.I.2", "2", t3lib_extMgm::extRelPath("2coltable")."selicon_tx_2coltable_inhalte_ausrichtung_2.gif"),
				),
				"size" => 1,	
				"maxitems" => 1,
			)
		),
		"breite" => Array (		
			"exclude" => 0,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.breite",		
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.breite.I.0", "0", t3lib_extMgm::extRelPath("2coltable")."selicon_tx_2coltable_inhalte_breite_0.gif"),
					Array("LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.breite.I.1", "1", t3lib_extMgm::extRelPath("2coltable")."selicon_tx_2coltable_inhalte_breite_1.gif"),
					Array("LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.breite.I.2", "2", t3lib_extMgm::extRelPath("2coltable")."selicon_tx_2coltable_inhalte_breite_2.gif"),
				),
				"size" => 1,	
				"maxitems" => 1,
			)
		),
		"ueberschrift" => Array (		
			"exclude" => 0,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.ueberschrift",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",	
				"eval" => "required",
			)
		),
		"text" => Array (		
			"exclude" => 0,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.text",		
			"config" => Array (
				"type" => "text",
				"cols" => "30",
				"rows" => "5",
				"wizards" => Array(
					"_PADDING" => 2,
					"RTE" => Array(
						"notNewRecords" => 1,
						"RTEonly" => 1,
						"type" => "script",
						"title" => "Full screen Rich Text Editing|Formatteret redigering i hele vinduet",
						"icon" => "wizard_rte2.gif",
						"script" => "wizard_rte.php",
					),
				),
			)
		),
		"image" => Array (		
			"exclude" => 0,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.image",		
			"config" => Array (
				"type" => "group",
				"internal_type" => "file",
				"allowed" => $GLOBALS["TYPO3_CONF_VARS"]["GFX"]["imagefile_ext"],	
				"max_size" => 100,	
				"uploadfolder" => "uploads/tx_2coltable",
				"show_thumbs" => 1,	
				"size" => 4,	
				"minitems" => 0,
				"maxitems" => 3,
			)
		),
		"linkname1" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.linkname1",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",
			)
		),
		"link1" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.link1",		
			"config" => Array (
				"type" => "input",		
				"size" => "15",
				"max" => "255",
				"checkbox" => "",
				"eval" => "trim",
				"wizards" => Array(
					"_PADDING" => 2,
					"link" => Array(
						"type" => "popup",
						"title" => "Link",
						"icon" => "link_popup.gif",
						"script" => "browse_links.php?mode=wizard",
						"JSopenParams" => "height=300,width=500,status=0,menubar=0,scrollbars=1"
					)
				)
			)
		),
		"linkname2" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.linkname2",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",
			)
		),
		"link2" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.link2",		
			"config" => Array (
				"type" => "input",		
				"size" => "15",
				"max" => "255",
				"checkbox" => "",
				"eval" => "trim",
				"wizards" => Array(
					"_PADDING" => 2,
					"link" => Array(
						"type" => "popup",
						"title" => "Link",
						"icon" => "link_popup.gif",
						"script" => "browse_links.php?mode=wizard",
						"JSopenParams" => "height=300,width=500,status=0,menubar=0,scrollbars=1"
					)
				)
			)
		),
		"linkname3" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.linkname3",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",
			)
		),
		"link3" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.link3",		
			"config" => Array (
				"type" => "input",		
				"size" => "15",
				"max" => "255",
				"checkbox" => "",
				"eval" => "trim",
				"wizards" => Array(
					"_PADDING" => 2,
					"link" => Array(
						"type" => "popup",
						"title" => "Link",
						"icon" => "link_popup.gif",
						"script" => "browse_links.php?mode=wizard",
						"JSopenParams" => "height=300,width=500,status=0,menubar=0,scrollbars=1"
					)
				)
			)
		),
		"linkname4" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.linkname4",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",
			)
		),
		"link4" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.link4",		
			"config" => Array (
				"type" => "input",		
				"size" => "15",
				"max" => "255",
				"checkbox" => "",
				"eval" => "trim",
				"wizards" => Array(
					"_PADDING" => 2,
					"link" => Array(
						"type" => "popup",
						"title" => "Link",
						"icon" => "link_popup.gif",
						"script" => "browse_links.php?mode=wizard",
						"JSopenParams" => "height=300,width=500,status=0,menubar=0,scrollbars=1"
					)
				)
			)
		),
		"imgresized" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:2coltable/locallang_db.php:tx_2coltable_inhalte.imgresized",		
			"config" => Array (
				"type" => "check",
			)
		),
	),
	"types" => Array (
		"0" => Array("showitem" => "hidden;;1;;1-1-1, valign, ausrichtung, breite, ueberschrift, text;;;richtext[cut|copy|paste|formatblock|textcolor|bold|italic|underline|left|center|right|orderedlist|unorderedlist|outdent|indent|link|table|image|line|chMode]:rte_transform[mode=ts_css|imgpath=uploads/tx_2coltable/rte/], image, linkname1, link1, linkname2, link2, linkname3, link3, linkname4, link4, imgresized")
	),
	"palettes" => Array (
		"1" => Array("showitem" => "starttime, endtime, fe_group")
	)
);
?>
jwitt ·

Hallo Begar
Am imgresized ist alles richtig. Habs mal in eine tca reinkopiert. und die checkbox erscheint. Musste woanderst suchen.
Gruß
Jens