Zum Inhalt springen

Flexform Felder im Backend ausblenden

Erstellt am 19. Mai 2011 · 9 Antworten · letzte Antwort am 9. September 2014

Tags: Frage

anderlk ·

Hallo miteinander,

seit TYPO3 4.5 kann man doch im Backend auch Felder ausblenden, welche keine Datenbankfelder sind, sondern über eine Flexform definiert wurden.
In meinem Fall möchte ich für eine Benutzergruppe bestimmte Felder einer Flexform ausblenden.

Da ich hierzu keine ausreichende Dokumenation gefunden habe, bin ich mal über Google auf die Suche gegangen.

Dort habe ich folgendes Ts gefunden um die Flexformen anzusprechen und auszublenden:

TCEFORM.[table].[flex-field].[DS-key].[sheet-name].[field-name].disabled = 1

Nur weiß ich jetzt nicht ganz, was ich für Die einzelnen Platzhalter einsetzten muss?

Es geht um die Erweiterung: facebook_socialplugins

Hier mal ein Auszug aus der Flexforms.xml:

<T3DataStructure>
    <meta TYPE="array">
    <langDisable>1</langDisable>
    </meta>
    <sheets type="array">
        <sDEF type="array">
            <ROOT type="array">
                <TCEforms type="array">
                    <sheetTitle>LLL:EXT:facebook_socialplugins/locallang_db.xml:sheet.general</sheetTitle>
                </TCEforms>
                <type>array</type>
                <el type="array">
                    <type_form>
                        <TCEforms>
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.type</label>
                            <onChange>reload</onChange>
                            <config>
                                <type>select</type>
                                <eval>required</eval>
                                <size>1</size>
                                <maxitems>1</maxitems>
                                <items>
                                    <numIndex index="0" type="array">
                                        <numIndex index="0"></numIndex>
                                        <numIndex index="1">0</numIndex>
                                    </numIndex>
                                    <numIndex index="1" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.type.activity_feed</numIndex>
                                        <numIndex index="1">activity_feed</numIndex>
                                    </numIndex>
                                    <numIndex index="2" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.type.comments</numIndex>
                                        <numIndex index="1">comments</numIndex>
                                    </numIndex>
                                    <numIndex index="3" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.type.facepile</numIndex>
                                        <numIndex index="1">facepile</numIndex>
                                    </numIndex>
                                    <numIndex index="4" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.type.like_button</numIndex>
                                        <numIndex index="1">like_button</numIndex>
                                    </numIndex>
                                    <numIndex index="5" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.type.like_box</numIndex>
                                        <numIndex index="1">like_box</numIndex>
                                    </numIndex>
                                    <numIndex index="6" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.type.live_stream</numIndex>
                                        <numIndex index="1">live_stream</numIndex>
                                    </numIndex>
                                    <numIndex index="7" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.type.login_button</numIndex>
                                        <numIndex index="1">login_button</numIndex>
                                    </numIndex>
                                    <numIndex index="8" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.type.recommendations</numIndex>
                                        <numIndex index="1">recommendations</numIndex>
                                    </numIndex>
                                </items>
                            </config>
                        </TCEforms>
                    </type_form>
                    
                    
                    
                    
                <!-- Activity Feed - Begin -->
                    <a_doku>
                        <TCEforms TYPE="array">
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.manual</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config TYPE="array">
                                <type>none</type>
                                <default>http://developers.facebook.com/docs/reference/plugins/activity</default>
                            </config>
                        </TCEforms>
                    </a_doku>
                    
                    <a_show_in_iframe>
                        <TCEforms TYPE="array">
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.show_in_iframe</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config TYPE="array">
                                <type>check</type>
                            </config>
                        </TCEforms>
                    </a_show_in_iframe>
                    
                    <a_domain>
                        <TCEforms type="array">
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.domain</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config type="array">
                                <type>input</type>
                                <eval>required</eval>
                            </config>
                        </TCEforms>
                    </a_domain>
                    
                    <a_width type="array">
                        <TCEforms type="array">
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.width</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config type="array">
                                <size>5</size>
                                <max>5</max>
                                <checkbox>1</checkbox>
                                <eval>int</eval>
                                <default>300</default>
                                <type>input</type>
                            </config>
                        </TCEforms>
                    </a_width>
                    
                    <a_height type="array">
                        <TCEforms type="array">
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.height</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config type="array">
                                <size>5</size>
                                <max>5</max>
                                <checkbox>1</checkbox>
                                <eval>int</eval>
                                <default>300</default>
                                <type>input</type>
                            </config>
                        </TCEforms>
                    </a_height>
                    
                    <a_show_header type="array">
                        <TCEforms TYPE="array">
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.show_header</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config TYPE="array">
                                <type>check</type>
                                <default>1</default>
                            </config>
                        </TCEforms>
                    </a_show_header>
                    
                    <a_color_scheme>
                        <TCEforms>
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.color_scheme</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config>
                                <type>select</type>
                                <eval>required</eval>
                                <size>1</size>
                                <maxitems>1</maxitems>
                                <items>
                                    <numIndex index="0" type="array">
                                        <numIndex index="0"></numIndex>
                                        <numIndex index="1">0</numIndex>
                                    </numIndex>
                                    <numIndex index="1" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.color_scheme.light</numIndex>
                                        <numIndex index="1">light</numIndex>
                                    </numIndex>
                                    <numIndex index="2" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.color_scheme.dark</numIndex>
                                        <numIndex index="1">dark</numIndex>
                                    </numIndex>
                                </items>
                            </config>
                        </TCEforms>
                    </a_color_scheme>
                    
                    <a_font>
                        <TCEforms>
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.font</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config>
                                <type>select</type>
                                <eval>required</eval>
                                <size>1</size>
                                <maxitems>1</maxitems>
                                <items>
                                    <numIndex index="0" type="array">
                                        <numIndex index="0"></numIndex>
                                        <numIndex index="1">0</numIndex>
                                    </numIndex>
                                    <numIndex index="1" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.font.arial</numIndex>
                                        <numIndex index="1">arial</numIndex>
                                    </numIndex>
                                    <numIndex index="2" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.font.lucida_grande</numIndex>
                                        <numIndex index="1">lucida+grande</numIndex>
                                    </numIndex>
                                    <numIndex index="3" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.font.segoe_ui</numIndex>
                                        <numIndex index="1">segoe+ui</numIndex>
                                    </numIndex>
                                    <numIndex index="4" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.font.tahoma</numIndex>
                                        <numIndex index="1">tahoma</numIndex>
                                    </numIndex>
                                    <numIndex index="5" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.font.trebuchet_ms</numIndex>
                                        <numIndex index="1">trebuchet+ms</numIndex>
                                    </numIndex>
                                    <numIndex index="6" type="array">
                                        <numIndex index="0">LLL:EXT:facebook_socialplugins/locallang_db.xml:field.font.verdana</numIndex>
                                        <numIndex index="1">verdana</numIndex>
                                    </numIndex>
                                </items>
                            </config>
                        </TCEforms>
                    </a_font>
                    
                    <a_border type="array">
                        <TCEforms type="array">
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.border_color</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config type="array">
                                <size>7</size>
                                <max>7</max>
                                <type>input</type>
                            </config>
                        </TCEforms>
                    </a_border>
                    
                    <a_show_recommendations type="array">
                        <TCEforms TYPE="array">
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.show_recommendations</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config TYPE="array">
                                <type>check</type>
                                <default>1</default>
                            </config>
                        </TCEforms>
                    </a_show_recommendations>
                <!-- Activity Feed - End -->
.......

Nehmen wir mal an, dass ich die Checkbox zum laden im iFrame ausblenden möchte:

<a_show_in_iframe>
                        <TCEforms TYPE="array">
                            <label>LLL:EXT:facebook_socialplugins/locallang_db.xml:field.show_in_iframe</label>
                            <displayCond>FIELD:type_form:=:activity_feed</displayCond>
                            <config TYPE="array">
                                <type>check</type>
                            </config>
                        </TCEforms>
                    </a_show_in_iframe>

Wie muss ich das laut obigen TS in der Group TsConfig umsetzen? Vielleicht kann mir da einer weiterhelfen?

Gruß Andreas

Silkea ·

Hallo Andreas,

hast du das zufällig gelöst bekommen? Habe bisher auch noch keine Lösung finden können für das Problem.

vg Silkea

simonborn ·

Hallo.

Ich beiße mir grade an einem ähnlichen (demselben?) Problem die Zähne aus. Möchte ein Feld im "Erweiterungsoptionen / Barrierefreiheit" Tab des Standard Tabellenelementes ausblenden:

TCEFORM.tt_content.pi_flexform.tx_cssstyledcontent_pi1.sDEF.acctables_summary.disabled = 1

...ohne Erfolg. Habe mich auch wundgegooglet und noch niemanden gefunden, der diese neue Flexform Konfiguration über TS hinbekommen hätte...

Hat das irgendjemand schonmal hinbekommen?

anderlk ·

Habs leider noch nicht lösen können.

Im Moment hab ich halt die Redakteure angewiesen diese bestimmten Felder nicht auszufüllen.

Gruß Anderl

gridme ·

Suche gerade auch eine Möglichkeit nur Bereiche (z.B. den Header) in flexforms (mit templavoila erstellt) zu entfernen.

Eigentlich sollte das gehen:
TCEFORM.tt_content.pi_flexform.tx_templavoila_pi1.header.disabled = 1

Generell für alle Header (normale CE und Flexforms) funktioniert folgendes TS:
TCEFORM.tt_content {
header.disabled = 1
subheader.disabled = 1
}

Wer hat hier einen Tipp?

chriskapeller

anderlk ·

Für alle FCE gehts so:

TCEFORM.tt_content.subheader.types.templavoila_pi1.disabled = 1

Ich würde halt gerne noch nach FCE unterscheiden.

Gruß Anderl

Freiraum ·

FlexForm Felder ausblenden:

TCEFORM.[table].[flex-field].[DS-key].[sheet-name].[field-name].disabled = 1

[table] = z.B. tt_content
[flex-field] = in der Regel "pi_flexform"
[DS-key] = Von einer Ext. oder SysExt. vergebener DataStructure-Key
Den DS-Key findet man im Backend unter Adminwerkzeuge > Konfiguration > $TCA-Tabellenkonfiguration:

$TCA['tt_content']['columns']['pi_flexform']['config']['ds']...

Hier steht dann auch der Pfad zur XML-Datei der Extension.
Ab hier im XML der Ext. schauen wie es weiter geht.

Als Beispiel mal das XML der Ext. belink_slideshow:

<T3DataStructure>
	<meta>
		<langDisable>1</langDisable>
	</meta>
	<sheets>
		<config>
			<ROOT>
				<TCEforms>
					<sheetTitle>LLL:EXT:belink_slideshow/pi1/locallang_db.xml:flexform.config</sheetTitle>
				</TCEforms>
				<type>array</type>
				<el>

					<templateFile>
						<TCEforms>
							<label>...</label>
							<config>
								<type>select</type>
								<itemsProcFunc>...</itemsProcFunc>
								<pluginKey>belink_slideshow_pi1</pluginKey>
							</config>
						</TCEforms>
					</templateFile>

... etc.

[sheet-name] = Das "Sheet" in dem etwas verändert werden soll.
In unserem Fall <config>

[field-name] = Das Ziel-Feld
... hier <templateFile>

Noch mal zusammengefasst:

TCEFORM.tt_content.pi_flexform.belink_slideshow_pi1.config.templateFile.disabled = 1
Kurt51 ·

Irgendwie klappt das bei der Ext. rgsmoothgallery nicht!?
Kann mal jemand "drüber schauen", wo ich den Fehler mache?

Ich habe es so

TCEFORM.tt_content.pi_flexform.advanced.externalthumbs.disabled = 1

und so

TCEFORM.tt_content {
   pi_flexform.tx_rgsmoothgallery_pi1.advanced {
      externalthumbs.disabled = 1
      externalcontrol.disabled = 1
      advancedsettings.disabled = 1
   }
}

und das auch noch mit anderem Schlüssel:

... pi_flexform.rgsmoothgallery.advanced ...

probiert, nichts davon zieht.

Kurt51 ·

So, ich hab's für rgsmoothgallery:

page.TCEFORM.tt_content {
   pi_flexform.rgsmoothgallery_pi1.advanced {
      externalthumbs.disabled = 1
      externalcontrol.disabled = 1
      advancedsettings.disabled = 1
   }
}
Tobikoehler ·

Braucht noch wer die Konfiguration für das table-content-element?

TCEFORM.tt_content.pi_flexform.table {
	sDEF {
		acctables_caption.disabled = 1
		acctables_summary.disabled = 1
		acctables_tfoot.disabled = 1
		acctables_headerpos.disabled = 1
		acctables_nostyles.disabled = 1
		acctables_tableclass.disabled = 1
	}
	s_parsing {
		tableparsing_quote.disabled = 1
		tableparsing_delimiter.disabled = 1
		tableparsing_trimfields.disabled = 1
		tableparsing_cellParseFunc.disabled = 1
	}
}

Damit ist alles deaktiviert innerhalb des FlexForms und somit auch weg (bis auf die Überschrift)

Grüße,
Tobi