Folgende Codes habe ich für mich gesammelt, weil ich Sie oft brauche. Ich erweitere es immer wieder. Wenn es irgend jemandem nutzt, freue ich mich. Was es nicht gibt (und nicht geben wird) ist eine Inhaltsübersicht, sorry. Bitte einfach mit der Suchfunktion des Browsers suchen.
I collected this code for myself, for I need it day by day. The collection will grow. I'm happy if somebody finds it useful. There is (and will be) no content, sorry. Please use the search function of your browser.
J'ai collecté ceci pour moi premièrement, mais je serais content, si c'est utile pour vous aussi. Si je suis libre, je vais rajouter d'autres pièces, mais il n'y a pas (ni sera) un sommaire, pardon pour ça. Simplement utilisez la fonction de la recherche de votere browser, s'il vous plaît.
Schönen Tag / have a nice day / bonne journée
christian.oettinger(das at-Zeichen)gmx.de
Link mit Anker
Link with Anchor
Erweiterung: Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$link= '<A HREF="'.$this->pi_getPageLink($this->oeallfilmpageid).'#nonfiktionale_film_'.$this->internal['currentRow']['uid'].'">'.$this->internal['currentRow']['title'].'</A>';
Link mit zusaetzlichen (GET-) Parametern
Link with additional (GET-) Parameters
Erweiterung: Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$url_parameters = array();
$url_parameters["tx_oebooksandmagazines_pi1[showUid]"] = $relatedbook_uid_actual;
$oe_book2book_ausgabe.= $this->pi_linkToPage( LINKTEXT, UID OF PAGE, '', $url_parameters);
Linkwizard-Links in Erweiterung, unterscheidet zwischen intern/extern/mailto
Linkwizard-Links in Extension, differentiates between intern/extern/mailto
Erweiterung: Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
case "link":
// For we don't know which kind of link is set, we use typolink
$conf = array(
"parameter" => $this->getFieldContent('link');
// here we can add all kinds of typoLink Parameters, see TSREF
);
$link = $this->cObj->typoLink("Mein Link", $conf);
return $link;
break;
IMAGE with TYPOLINK
Typoscript (TS): Setup
temp.gross= IMAGE
temp.gross.file = {$typegroesser}
temp.gross.stdWrap {
wrap = |{$smallercleargif}
typolink {
parameter.data = TSFE:id
additionalParams = &type=1
}
}
Pfad zur Erweiterung
Path to extension
Erweiterung: Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
t3lib_extMgm::extRelPath()
t3lib_extMgm::extPath()
typo3 mail-funktion, html-mail
typo3 mail function, html-mail
Erweiterung: Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$html_start='<html><head><title>Anmeldung bei St.Martin</title></head><body>';
$oemessage = 'Liebe(r) '.$tx_oesmallevents_pi1_name.'<br><br>';
$oemessage.= 'Sie haben sich für folgende Veranstaltung von St.Martin angemeldet:<br>';
$oemessage.= '<b>'.$tx_oesmallevents_pi1_veranstaltung.'</b>';
$oemessage.= '<br>(Achtung: Bitte überweisen Sie bei Seminaranmeldungen erst nach Erhalt der schriftlichen Zusage!)<br>';
$oemessage.= '<br><br><b>Adresse:</b><br>'.nl2br($tx_oesmallevents_pi1_address);
$oemessage.= '<br><br><b>Bemerkungen:</b><br>'.nl2br($tx_oesmallevents_pi1_comments);
$oemessage.= '<br>';
$html_end='</body></html>';
require_once(PATH_t3lib.'class.t3lib_htmlmail.php');
$this->htmlMail = t3lib_div::makeInstance('t3lib_htmlmail');
$this->htmlMail->start();
$this->htmlMail->recipient = $tx_oesmallevents_pi1_email;
$this->htmlMail->recipient_copy = $this->conf['order_mail'];
$this->htmlMail->replyto_email = $this->conf['from_mail'];
$this->htmlMail->replyto_name = 'St. Martin';
$this->htmlMail->subject = 'Anmeldung bei St.Martin';
$this->htmlMail->from_email = $this->conf['from_mail'];
$this->htmlMail->from_name = 'St.Martin';
$this->htmlMail->returnPath = $this->conf['from_mail'];
$this->htmlMail->addPlain($oemessage);
$this->htmlMail->setHTML($this->htmlMail->encodeMsg($html_start.$oemessage.$html_end));
$this->htmlMail->send($this->conf['infomail']);
Zusaetzliche Where-clause in der Datenbank-Abfrage der List View
Additional Where-clauses in Database-Query of listView
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
// additional where clauses
$oe_addwhere = ' AND day LIKE '.$dayuid;
// Get number of records:
$res = $this->pi_exec_query('tx_astridnonfikprogramm_filme',1, $oe_addwhere);
list($this->internal['res_count']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
// Make listing query, pass query to SQL database:
$res = $this->pi_exec_query('tx_astridnonfikprogramm_filme', 0, $oe_addwhere);
$this->internal['currentTable'] = 'tx_astridnonfikprogramm_filme';
Felder definieren/einschraenken, die in der Datenbank-Abfrage der List View geholt werden
Reduce/Define fields fetched in Database-Query of listView
Erweiterung: im plugin (pi) php code: listView
Extension: inside of the php code of the plugin (pi): listView
$this->pi_listFields = 'uid,pid,hidden,erreger,titel,titel2,titel3,land,produktlinie';
PageBrowser anpassen
Adjust PageBrowser
Erweiterung: im plugin (pi) php code: listView
Extension: inside of the php code of the plugin (pi): listView
$this->internal['pagefloat'] = 'center';
$this->internal['showFirstLast'] = 0;
RTE Feld parsen und richtig ausgeben
parse and give out Text-field with RTE
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$this->pi_RTEcssText($this->internal['currentRow']['text']);
Tabellen im RTE einrichten
Configure Tables in RTE
UserTSConfig
RTE.classes{
tblGreenFee1 {
name = Zelle hell
}
tblGreenFee2 {
name = Zelle dunkel
}
tblGreenFeebreit{
name = Zelle breit
}
}
RTE.default {
...
classesCharacter = tblGreenFee1, tblGreenFee2, GreenFee, tblGreenFeebreit
classesTD = tblGreenFee1, tblGreenFee2, tblGreenFeebreit
classesTH = tblGreenFee1, tblGreenFee2
classesTable = GreenFee
proc {
...
allowedClasses = tblGreenFee1, tblGreenFee2, GreenFee, tblGreenFeebreit
}
}
# Maybe you'll need this additionally (don't know why and when):
RTE.config.tt_content.bodytext {
proc.allowedClasses = GreenFee, tblGreenFee1, tblGreenFee2, tblGreenFeebreit
}
Typoscript (TS): Setup
# clear (or change) the class normally wrapped around the table
lib.parseFunc_RTE.externalBlocks.table.stdWrap.HTMLparser.tags.table.fixAttrib.class.list ...
inside CSS
th.tblGreenFee2, td.tblGreenFee2{
background: #1c5360;
color: #fff;
}
th.tblGreenFee1, td.tblGreenFee1{background: #e2e9ea;}
table.GreenFee td {
vertical-align: middle;
font-size: 10px;
padding: 2px;
}
td.tblGreenFeebreit{width: 95px;}
table.GreenFee{width: 305px;}
// same in RTE css
Datenbankabfrage: exec_SELECTquery
Database: exec_SELECTquery
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid',
$this->internal['currentTable'],
'pid = '.$this->conf['certificatesfolder'].$this->cObj->enableFields($this->internal['currentTable']),
'',
'sorting',
'1'
);
while($row=mysql_fetch_assoc($res)) {
Datenbankabfrage: insert_SELECTquery
Database: insert_SELECTquery
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$insert_table = 'tx_oecertificates_watcheddowloadstatistics';
$insert_array = array(
'pid' => $this->conf['watcheddownload_stat_pid'],
'crdate' => time(),
'tstamp' => time(),
'customer_mail' => $email['address'],
'abcert_mail' => $email['copy'],
'item_name' => $datei[$i],
'from_pid' => $this->internal['currentRow']['pid'],
'language_uid' => $this->internal['currentRow']['sys_language_uid'],
'from_cert_uid' => $this->internal['currentRow']['uid'],
'from_cert_name' => $this->internal['currentRow']['name'],
);
$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery($insert_table, $insert_array);
Seitentitel anpassen
adjust page title
Typoscript (TS): Setup
config.noPageTitle = 1
page {
headerData {
8 = TEXT
8 {
field = title
wrap = <title>Der TYPO3 BLOG - |</title>
}
}
}
HTML-Header-Data aus dem plugin anpassen (hier fuer Titel & Schlagworte)
adjust HTML-Header Data from inside of the plugin (here used for title ans keywords)
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$headertitel = $GLOBALS['TSFE']->page['title'];
$headekeywords = $GLOBALS['TSFE']->page['title'];
$GLOBALS['TSFE']->additionalHeaderData[$this->extKey] = '<title>XXX - '.$headertitel.'</title>
<meta name="keywords" content="XXX,'.$headekeywords.'" />';
Ausrichtungsmoeglichkeiten der Bilder im BE (Text mit Bild) anpassen
Adjust orientation of Images in Backend (Text with images)
PageTSConfig / UserTSConfig
TCEFORM.tt_content.imageorient.removeItems = ...
# List of possibilities:
#0 = Above, center
#2 = Above, left
#8 = Below, center
#9 = Below, right
#10 = Below, left
#17 = In text, right
#18 = In text, left
#25 = In text, right (nowrap)
#26 = In text, left (nowrap)
Grafische Ueberschrift, Suchmaschinenfreundlich
Graphical Header, search engine friendly
Typoscript (TS): Setup
lib.stdheader >
lib.stdheader = CASE
lib.stdheader {
1=IMG_RESOURCE
1{
stdWrap.dataWrap = <h1 style="background-image:url(|)"><span>{current:1}</span></h1>
file = GIFBUILDER
file {
format=png
XY = [10.w]+5,35
backColor = #ffffff
10 = TEXT
10 {
text.current = 1
fontSize = 22
offset = 0,20
fontFile = fileadmin/fonts/AVENLTSL.TTF
fontColor = #000000
niceText = 1
}
}
stdWrap.if.isTrue.field=header
}
2=TEXT
2.current=1
2.fontTag=<h2>|</h2>
3=TEXT
3.current=1
3.fontTag=<h3>|</h3>
4=TEXT
4.current=1
4.fontTag=<h4>|</h4>
5=TEXT
5.current=1
5.fontTag=<h5>|</h5>
setCurrent {
field=header
htmlSpecialChars=1
typolink.parameter.field=header_link
}
key.field=header_layout
key.ifEmpty=1
key.ifEmpty.override.data=register:defaultHeaderType
}
Read more: www.typo3wizard.com/en/snippets/typo3-seo/search-engine-friendly-graphical-header.html
#ixzz0wPMRjDdr
Under Creative Commons License: Attribution
mehrzeilige Ueberschrift (aehnlich splitChar mit grafischer Ueberschrift)
Header with multiple lines (like splitChar with graphical Header)
Typoscript (TS): Setup
lib.stdheader.10.1 {
split {
token = |
#Objekte fuer die Textteile zuweisen:
cObjNum = 1 |*| 1 |*| 2
#Objekt faer alle Textteile ausser dem letzten: (mit <br>!)
1 = TEXT
1.current = 1
1.wrap = |
#Objekt den letzten Textteil: (ohne <br>!)
2 = TEXT
2.current = 1
2.wrap = <br />|
3 = TEXT
3.current = 1
3.wrap = <br />|
}
}
mehrzeilige Seitentitle im Text-Menu TMENU (aehnlich splitChar)
Page title with multiple lines in TMENU (like splitChar)
Typoscript (TS): Setup
temp.mainmenu = HMENU
temp.mainmenu {
entryLevel = 0
1 = TMENU
1 {
stdWrap.wrap = <div id="mainmenu"><ul class="mainmenu">|</ul></div>
target = _top
expAll = 0
NO {
wrapItemAndSub = <li>|</li>
ATagParams = class="mainmenu_no"
1 = COA
1 {
10 = TEXT
10 {
field = nav_title // title
listNum = 0
listNum.splitChar = |
}
20 <.10
20 {
listNum = 1
wrap = <br />|
required = 1
}
}
stdWrap.field >
stdWrap.cObject = TEXT
stdWrap.cObject <.1
}
ACT <.NO
ACT = 1
ACT {
ATagParams = class="mainmenu_act"
}
}
}
Bedingung (PidinRootline) -> Content aus anderer Spalte ausgeben
Condition (PidinRootline) -> give out Content from other column
Typoscript (TS): Setup
[PIDinRootline = 22]
temp.boxes = CONTENT
temp.boxes {
table = tt_content
select {
pidInList.field = uid
orderBy = sorting
where = colPos = 2
}
}
[end]
Pruefen ob BE-User eingeloggt ist
Check if BE-User logged in
Erweiterung: Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
if ($GLOBALS["TSFE"]->beUserLogin > 0) {
...
Typoscript (TS): Setup
[globalVar = TSFE : beUserLogin > 0]
...
[global]
Pruefen ob BE-User admin ist
Check if BE-User is admin
Erweiterung: Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
if ($GLOBALS['BE_USER']->user['admin']) {
...
Typoscript (TS): Setup
[globalVar = BE_USER:user:admin = 1]
Backend: Spalten ausblenden
Backend: Hide Columns
Page TSConfig
# Spalten auf einer Seite einschrä4nken
# restrict Columns shown on a Page
mod.SHARED.colPos_list = 0,2
# Spalten-Auswahl in der Eingabemaske des Inhaltselements (Select-Box) einschrä4nken
# restrict Comlums available in Select-Box inside the Content Element
TCEFORM.tt_content.colPos.keepItems = 0,2
# oder (andersrum) | or alternatively: TCEFORM.tt_content.colPos.removeItems = 1,3
Backend: Spalten abhaengig vom Layout-Feld in der Tabelle pages anzeigen oder ausblenden: UserFunc-Bedingung im Page TSConfig
Backend: Show/hide Columns depending on layout filed in table pages: User_func Condition in Page TSConfig
Page TSConfig
mod.SHARED.colPos_list = 0,2
[userFunc = user_match(nureineSpalte)]
mod.SHARED.colPos_list = 0
[end]
in localconf.php
include_once('oeuserfunc.inc');
Eigene Funktion in der Datei "oeuserfunc.inc" (liegt im Ordner "typo3conf/")
Own function in the included file "oeuserfunc.inc" (lies in folder "typo3conf/")
<?php
function user_match($cmd){
switch($cmd) {
case "nureineSpalte":
$uid= t3lib_div::GPVar('id');
$table = 'pages';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('layout', $table, 'uid = '.$uid, '', 'sorting', '1');
$row=mysql_fetch_assoc($res);
if ($row['layout'] == 0 ) return true;
else return false;
break;
}
}
?>
Metatags ohne Erweiterung
Meta tags without Extension
Typoscript (TS): Setup
### SEO Meta-Tags ###
(page.headerData >) <- Eventuell weglassen!!!!
page.headerData.30 = TEXT
page.headerData.30.value (
<title>{page:title} - {page:subtitle} | blog.ingeniumdesign.de</title>
<meta name="author" content="Sebastian Schmal" />
<meta name="publisher" content="Sebastian Schmal" />
<meta name="description" content="{page:description}" />
<meta name="keywords" content="{page:keywords}" />
<meta name="language" content="de" />
<meta name="robots" content="index, follow" />
<meta name="revisit-after" content="7 days" />
<meta name="copywrite" content="blog.ingeniumdesign.de" />
)
page.headerData.30.insertData = 1
metags erweiterung, schluesselwoerter pro seite
metags extension, keywords per page
Typoscript (TS): Constants
plugin.meta {
robots = INDEX,FOLLOW
author = typo3, astrid, das oe, viele Gruesse und eine schoenen Tag!
language = de
revisit = 5 Days
}
Typoscript (TS): Setup
plugin.meta >
plugin.meta = PHP_SCRIPT
plugin.meta {
file = EXT:metatags/meta.php
global {
description = {$plugin.meta.description}
keywords = {$plugin.meta.keywords}
robots = {$plugin.meta.robots}
copyright = {$plugin.meta.copyright}
author = {$plugin.meta.author}
language = $plugin.meta.language}
distribution = {$plugin.meta.distribution}
revisit = {$plugin.meta.revisit}
}
local {
description.field = description
keywords.field = keywords
}
flags {
useSecondaryDescKey = 1
alwaysGlobalDescription = {$plugin.meta.includeGlobal}
alwaysGlobalKeywords = {$plugin.meta.includeGlobal}
DC =1
}
}
Bedingung (Beispiel Schluesselworte): Typoscript (TS) If-Abfrage -> Feld nur ausgeben, wenn nicht leer. Alles in einem COA
Typoscript (TS) If-Condition (Example for keywords) -> give out field, only if not empty. Put everything in a COA (Content Object Array)
Typoscript (TS): Setup
page.100 = COA
page.100 {
stdWrap.wrap = <div id="content"> | </div>
10 = CONTENT
10 {
table = tt_content
select {
pidInList.field = uid
orderBy = sorting
where = colPos = 0
languageField = sys_language_uid
}
}
// if field keywords is not empty, an additional sentence (defined in constants is written down)
30 = TEXT
30.value = {$keyword_sentence}
30.if {
isFalse.field = keywords
negate = 1
}
// now give out keywords (if empty there will be written nothing of course, so no need to do the if condition here)
40 = TEXT
40 {
field = keywords
}
}
Werte an Plugin (pi, pi1) uebergeben
Prepare variables/values for Plugin (pi, pi1) uebergeben
Typoscript (TS): Setup
plugin.tx_oeabcertstartpage_pi2.picture_store_pid = 82
plugin.tx_oeabcertstartpage_pi2.picture_width = 70
inside the plugin
$this->conf['picture_store_pid']
Popup-Context-Menue im Seitenbaum ausschalten
switch off context menu (popup) in page tree
UserTSConfig
options.folderTree.disableIconLinkToContextmenu = titlelink
options.pageTree.disableIconLinkToContextmenu = titlelink
Verschiedene Icons inm BE im Listen-Tool, abhaengig vom Wert eines Feldes
Different Icons in BE in list tool, depending on value of any field
ext_tables.php
t3lib_div::loadTCA("fe_users");
$TCA['fe_users']['ctrl']['typeicon_column'] = 'usergroup';
$TCA['fe_users']['ctrl']['typeicons'] = Array (
'5' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_blauuser.gif',
'7' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_rotuser.gif',
);
OR
t3lib_div::loadTCA("fe_users");
$TCA['fe_users']['ctrl']['typeicon_column'] = 'usergroup';
$TCA['fe_users']['ctrl']['typeicons'] = Array (
'5' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_blauuser.gif',
'7' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_rotuser.gif',
);
Elemente im Popup-Context-Menue im Seitenbaum ausblenden
disable items in context menus (popup)
UserTSConfig
options.contextMenu.pageTree.disableItems = view,edit,hide,new,info,copy,cut,paste,delete,move_wizard,history,perms,new_wizard,edit_access,edit_pageheader,db_list,versioning,moreoptions
options.contextMenu.folderTree.disableItems = edit,upload,rename,new,info,copy,cut,paste,delete
all keys: pageTree, pageList, folderTree, folderList, page, folder
Admin-Panel ausblenden, aber FE- Bleistifte einbelnden (FE-Editing)
hide Admin-Panel but show pencil Icons for FE-Editing
UserTSConfig
admPanel = 1
admPanel {
enable.edit = 1
module.edit.forceNoPopup = 1
module.edit.forceDisplayFieldIcons = 1
module.edit.forceDisplayIcons = 1
hide = 1
}
Setup
config {
admPanel = 0
}
Edit Icons (Bleistife) fuer Datensaetze einer eigenen Extension hinzufuegen
(eigene Extension durch FE-Editing bearbeitbar machen)
add Edit Icons Pencils for records of own Extension
(make own extension FE-editable)
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$this->pi_getEditIcon($this->getFieldContent('additional_w_iamge'),'additional,additionalpicture,additionalpictureposition,additionalpicturewidth',$this->pi_getLL('listFieldHeader_additional'),$this->internal['currentRow'])
POST- und GET- Variablen holen
fetch POST- and GET- Variables
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
t3lib_div::_GET()
t3lib_div::_POST()
t3lib_div::_GP($var) (priority to post)
Flexform in plugin einer eigenen Erweiterung einbauen und auslesen
insert and read out Flexform in plugin of own Extension
Erweiterung: ext_tables.php
Extension: ext_tables.php
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY.'_pi1']='pi_flexform';
t3lib_extMgm::addPiFlexFormValue($_EXTKEY.'_pi1','FILE:EXT:oezsvzeitschrift/flexform_ds_pi1.xml');
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$this->pi_initPIflexForm();
$check_series = $this->pi_getFFvalue($this->cObj->data['pi_flexform'],'display_series','sDEF');
Flexform-XML-Datei-Beispiel: checkboxes
Flexform XML file example: checkboxes
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:astridzsvbooks/locallang_db.xml:tt_content.pi_flexform.sheet_display</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<display_new>
<TCEforms>
<label>LLL:EXT:astridzsvbooks/locallang_db.xml:tt_content.pi_flexform.sheet_show_new_publications</label>
<config>
<type>check</type>
</config>
</TCEforms>
</display_new >
<display_series>
<TCEforms>
<label>LLL:EXT:astridzsvbooks/locallang_db.xml:tt_content.pi_flexform.sheet_show_series</label>
<config>
<type>check</type>
</config>
</TCEforms>
</display_series >
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
Flexform-XML-Datei-Beispiel: radiobuttons
Flexform XML file example: radiobuttons
...
<config>
<type>radio</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">Aktuelles Heft (mit großem Bild)</numIndex>
<numIndex index="1">0</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">Archiv (Liste aller Hefte)</numIndex>
<numIndex index="1">1</numIndex>
</numIndex>
</items>
</config>
...
Flexform-XML-Datei-Beispiel: input
Flexform XML file example: input
...
<config>
<type>input</type>
<size>8</size>
</config>
...
Flexform-XML-Datei-Beispiel: Datei mit wizard
Flexform XML file example: file with wizard
...
<config>
<type>input</type>
<size>60</size>
<eval>trim</eval>
<default></default>
<wizards type="array">
<_PADDING>2</_PADDING>
<link type="array">
<type>popup</type>
<title>LLL:EXT:oeowncontentelement/locallang.xml:ff_file.browseUrlTitle</title>
<icon>link_popup.gif</icon>
<script>browse_links.php?mode=wizard&act=file|url</script>
<params type="array">
<blindLinkOptions>page,folder,mail,spec</blindLinkOptions>
<allowedExtensions>class,swf,swa,dcr,wav,avi,au,mov,asf,mpg,wmv,mp3,mp4,m4v,flv</allowedExtensions>
</params>
<JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
</link>
</wizards>
</config>
...
Flexform-XML-Datei-Beispiel: Input-Feld mit Link-Wizard
Flexform XML file example: input field with link wizard
...
<config>
<type>input</type>
<size>20</size>
<wizards type="array">
<_PADDING>2</_PADDING>
<link type="array">
<type>popup</type>
<title>Link</title>
<icon>link_popup.gif</icon>
<script>browse_links.php?mode=wizard</script>
<JSopenParams>height=300,width=500,status=0,menubar=0,scrollbars=1</JSopenParams>
</link>
</wizards>
</config>
...
click enlarge IMAGE in Extension
Typoscript (TS): Setup (static of extension)
plugin.tx_astridmanuals_pi1 {
CMD =
pidList =
recursive =
listimageCObject=IMAGE
listimageCObject {
file.width=75
}
singleimageCObject=IMAGE
singleimageCObject {
file.width=150
imageLinkWrap = 1
imageLinkWrap {
enable = 1
bodyTag = <BODY bgColor=white>
wrap = |
width = 400m
height = 400
JSwindow = 1
JSwindow.newWindow = 1
JSwindow.expand = 17,20
}
}
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
case 'listimage':
$imgTSConfig=$this->conf['listimageCObject.'];
$imgTSConfig['file']='uploads/tx_astridmanuals/'.$this->internal["currentRow"]["image"];
return $this->cObj->IMAGE($imgTSConfig);
break;
case 'singleimage':
$imgTSConfig=$this->conf['singleimageCObject.'];
$imgTSConfig['file']='uploads/tx_astridmanuals/'.$this->internal["currentRow"]["image"];
return $this->cObj->IMAGE($imgTSConfig);
break;
IMAGE with GIFBUILDER
Typoscript (TS): Setup
temp.whereweare = IMAGE
temp.whereweare {
stdWrap{
wrap = <div id="kleinefarbflaechen"><div class="womanist">|</div></div>
typolink.parameter = {$fake_whereto}
}
file = GIFBUILDER
file {
XY = [10.w]+10,18
backColor = {$gray2}
10 = TEXT
10 {
fontFile = {$where_font}
fontSize = {$where_textsize}
fontColor = {$gray5}
offset = 5,13
text.data = leveltitle:1
# oder text.field = title
align = left
niceText = 1
niceText.sharpen = 40
}
}
}
Gifbuilder-BOX
Typoscript (TS): Setup - innerhalb NO {} eines GMENU oder GIFBUILDER-Objects
Typoscript (TS): Setup - inside of NO {} of a GMENU or GIFBUILDER-Object
20 = BOX
20 {
color = #000000
dimensions = 6,17,[10.w],1
}
Standard-Clearings
Typoscript (TS): Setup
#csc-header entfernen
lib.stdheader.stdWrap.dataWrap >
#ueberschriften ohne Zusaetze
lib.stdheader.2.headerStyle >
lib.stdheader.3.headerClass >
#noch mehr entfernen
tt_content.stdWrap.dataWrap =
# class="bodytext" bei RTE abstellen
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.addAttributes.P.class >
# Ummantelung mit <p> bei folgenden Tags verhindern
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.encapsTagList = cite, div, p, pre, hr, h1, h2, h3, h4, h5, h6,table,tr,td
config, page.config, icon, stylesheet, META, Abfrage (Condition)
Typoscript (TS): Setup
config {
admPanel = 0
no_cache = 0
debug = 1
linkVars = L
uniqueLinkVars = 1
baseURL = 1
baseURL = www.abcert.de/
simulateStaticDocuments = 0
tx_realurl_enable= 1
prefixLocalAnchors = all
sys_language_uid = 0
language = de
locale_all = de_DE
#intTarget = _top
#extTarget = _blank
}
page = PAGE
page.typeNum = 0
page.target = _top
page.bodyTag = <body bgcolor="{$background}">
page.shortcutIcon = fileadmin/gestaltung/abcert.ico
page.config {
index_enable = 1
search.rootPidList = -1
}
page.meta {
KEYWORDS =
DESCRIPTION =
ABSTRACT =
AUDIENCE =
page-topic =
ROBOTS = INDEX,FOLLOW
LANGUAGE = de
REVISIT-AFTER = after 15 days
}
[browser = msie]
page.stylesheet = ABCERT-dyn-msie.css
[else]
page.stylesheet = ABCERT-dyn.css
[end]
[browser = msie] AND [system = mac]
page.stylesheet = ABCERT-msie5-mac.css
[end]
Cache von ausgewaehlten Seiten loeschen, wenn Datensaetze geaendert werden
automatically clear cache of specified pages when editing own records
Typoscript (TS): Setup of Folder where Records are stored
// 70, 71, 97 in this case are ids of pages, of which the cache should be cleared when editing records
TCEMAIN.clearCacheCmd = 70,71,97
BE/Backend-User: Seitencache leeren ermoeglichen
Enable BE/Backenduser to clear page cache
UserTSConfig
options.clearCache.pages = 1
options.clearCache.all = 1
Result-Browser / Browse-Box richtig einstellen (Standard is nicht wirklich gut)
configure Result-Browser / Browse-Box (default is no good)
Erweiterung: im plugin (pi) php code: function listView
Extension: inside of the php code of the plugin (pi): function listView
$this->internal['pagefloat'] = 'center';
$this->internal['showFirstLast'] = 0;
Float-Problem bei Text mit Bild, wenn Text kuerzer als Bild
Float problem in element text with image, if little text (text shorter than image)
Typoscript (TS): Setup
# Do not just copy this! Use the Object browser of template tool and check tt_content.image.20.layout.18.value.
# Then update the already given value by inserting <div class="clear"></div>
tt_content.image.20.layout.18.value = <div class="csc-textpic csc-textpic-intext-left###CLASSES###">###IMAGES######TEXT###</div><div class="clear"></div>
tt_content.image.20.layout.17.value = <div class="csc-textpic csc-textpic-intext-right###CLASSES###">###IMAGES######TEXT###</div><div class="clear_r"></div>
inside CSS
.clear { clear: left; }
.clear_r { clear: right; }
Result-Browser / Browse-Box richtig einstellen (Standard is nicht wirklich gut)
configure Result-Browser / Browse-Box (default is no good)
im modul php code: ganz oben bei den require-Anweisungen
inside of the php code of the module: on the top
require_once (PATH_t3lib.'class.t3lib_page.php');
require_once (PATH_t3lib.'class.t3lib_tstemplate.php');
require_once (PATH_t3lib.'class.t3lib_tsparser_ext.php');
im modul php code: eigene Funktion
inside of the php code of the module: own function
function loadTS($pageUid) {
$sysPageObj = t3lib_div::makeInstance('t3lib_pageSelect');
$rootLine = $sysPageObj->getRootLine($pageUid);
$TSObj = t3lib_div::makeInstance('t3lib_tsparser_ext');
$TSObj->tt_track = 0;
$TSObj->init();
$TSObj->runThroughTemplates($rootLine);
$TSObj->generateConfig();
$this->conf = $TSObj->setup['plugin.']['tx_xyz_pi1.'];
}
im modul php code: wo immer man es braucht, vermutlich main
inside of the php code of the module: wherever you need it, probably main
$this->loadTS($this->id);
// now you can access $this->conf
PageTSConfig, Spalten, RTE
PageTSConfig, Columns, RTE
PageTSConfig
mod.SHARED.colPos_list = 0
RTE.config.tt_content.bodytext {
proc.allowedClasses = italic,fett,zwischen_ueberschrift
classesCharacter = italic,fett
classesParagraph = italic,fett,zwischen_ueberschrift
}
RTE.default {
hidePStyleItems = H1,H2,H3,H4,H5,H6,PRE
disabled = 0
enableWordClean = 1
removeTags = center,font,o:p,sdfield,strike,u,b,strong
useCss = 1
showTagFreeClasses = 1
contentCss = uploads/tf/rte.css
classesCharacter = italic,fett
classesParagraph = italic,fett,zwischen_ueberschrift
showButtons = blockstylelabel, blockstyle, textstylelabel, textstyle, subscript, superscript, textindicator, insertcharacter, link, findreplace, removeformat, undo, redo, table, rowsplit, rowinsertabove, rowinsertunder, rowdelete, columninsertbefore, columninsertafter, columndelete, columnsplit, cellsplit, cellmerge, tableproperties, rowproperties, cellproperties, bgcolor
hideButtons = formatblock,class,cut,copy,paste,fontsize,bold,italic,underline,left,center,right,orderedlist,unorderedlist,outdent,indent,emoticons,chMode,line,user,textcolor,strikethrough,outdent,indent,chMode,emoticon,toggleborders, about, cellinsertbefore, cellinsertafter, celldelet, image
proc {
allowedClasses = italic,fett,zwischen_ueberschrift
exitHTMLparser_db=1
exitHTMLparser_db {
p.fixAttrib.class.list =,italic,zwischen_ueberschrift
div.fixAttrib.class.list =,italic,zwischen_ueberschrift
span.fixAttrib.class.list =,italic,fett
allowTags = table,tbody,td,tr,br,p,th,h1,h2,h3,h4,h5,h6,i,div,span,ul,ol,il,li,pre,blockquote,em,b,a,link,img,nobr,hr
denyTags = b,strong
}
}
}
}
RTE.colors {
color1 {
name = dunkelgruen
value = #147959
}
color2 {
name = mittelgruen
value = #5AA18B
}
color3 {
name = hellmittelgruen
value = #80BEAB
}
}
RTE.default.colors = color1, color2,color3
tx_crawler.crawlerCfg.paramSets {
language = &L=[|_TABLE:pages_language_overlay;_FIELD:sys_language_uid]
language.procInstrFilter = tx_indexedsearch_reindex, tx_cachemgm_recache
language.baseUrl = p25919.typo3server.info/
certificates = &L=[|_TABLE:pages_language_overlay;_FIELD:sys_language_uid]&tx_oecertificates_pi1[showUid]=[_TABLE:tx_oecertificates_certificates]
certificates.procInstrFilter = tx_indexedsearch_reindex
certificates.cHash = 1
certificates.baseUrl = p25919.typo3server.info/
branch = &L=[|_TABLE:pages_language_overlay;_FIELD:sys_language_uid]&tx_oecertificates_pi2[showUid]=[_TABLE:tx_oecertificates_branch]
branch.procInstrFilter = tx_indexedsearch_reindex
branch.cHash = 1
branch.baseUrl = p25919.typo3server.info/
}
Indexed search installieren und um eigenen Parameter erweitern
install Indexed search and expand it by additional parameter
Typoscript (TS): Setup
config {
index_enable = 1
}
temp.content = CONTENT
temp.content {
stdWrap.wrap = <!--TYPO3SEARCH_begin-->|<!--TYPO3SEARCH_end-->
table = tt_content
select {
pidInList.field = uid
orderBy = sorting
where = colPos = 0
}
}
Erweiterung: ext_localconf.php
Extension: ext_localconf.php
// the last attribute ("1") sets, if the plugin is cached or not. It has to be, to be indexed
t3lib_extMgm::addPItoST43($_EXTKEY,'pi1/class.tx_astridzsvbooks_pi1.php','_pi1','list_type',1);
Erweiterung: im plugin (pi) php code
Extension: inside of the php code of the plugin (pi)
$this->pi_USER_INT_obj = 0; // Configuring so caching is expected. This value means that cHash params are set.
$this->pi_autoCacheEn = 1;
// adding additional parameter for indexed_search. If you do not, the first call of the page will be cached, you will never see
// anything than that. With the additional param though, one "page" is cached for each parameter (SingleView calls) and one
// without any (ListView call). In other words, although cached, you are able to get more than one content on one typo3-page.
$this->piautoCacheFields = array (
'tx_oebooksandmagazines_pi1[showUid]' => array ('list' => array (0,1)),
);
Erweiterung: im plugin (pi) php code: return der Funktion ListView
Extension: inside of the php code of the plugin (pi): return of function ListView
// with that List view output is hidden from search (otherwise each record will be found twice - one List, one Single View)
return '<!--TYPO3SEARCH_end-->'.$fullTable.'<!--TYPO3SEARCH_begin-->';
Crawler-Erweiterung installieren und konfigurieren 1: Grundlegend, BE, keine Erweiterungen, keine FE-User
Install and configure Crawler Extension 1: Basic, no Extensions, BE, no FE-User
PageTSConfig
tx_crawler.crawlerCfg.paramSets.std=
tx_crawler.crawlerCfg.paramSets.std{
procInstrFilter=tx_indexedsearch_reindex
baseUrl=www.DOMAIN.com/
}
Crawler-Erweiterung installieren und konfigurieren 2: crawler-script testen (d.h. Server testen)
Install and configure Crawler Extension 2: test crawler script (i.e. test server configuration)
soon to come
Crawler-Erweiterung installieren und konfigurieren 3: aufrufen per cronjob
Install and configure Crawler Extension 3: call via cronjob
soon to come
Crawler-Erweiterung installieren und konfigurieren 4: FE-User
Install and configure Crawler Extension 4: FE-User
soon to come
Crawler-Erweiterung installieren und konfigurieren 5: Erweiterungen
Install and configure Crawler Extension 5: Extensions
soon to come
realURL
.htaccess
RewriteEngine On
RewriteRule ^typo3$ - [L]
RewriteRule ^typo3/.*$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule.* index.php
ext.localconf.php
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
'init' => array(
'enableCHashCache' => 1,
'enableUrlDecodeCache' => 1,
'enableUrlEncodeHash' => 1,
// 'postVarSet_failureMode' => 'redirect_goodUpperDir',
),
'redirects' => array(
'service/logo.html' => '/deutsch/ueber-abcert/abcert-logo.html',
),
'preVars' => array(
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => '0',
'deutsch' => '0',
'en' => '2',
'english' => '2',
'it' => '3',
'italiano' => '3',
'cz' => '4',
'czech' => '4',
),
'valueDefault' => 'deutsch',
),
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => '1',
),
'noMatch' => 'bypass',
),
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 30,
'rootpage_id' => '1',
),
'fixedPostVarSets' => array(),
'postVarSets' => array(
'_DEFAULT' => array (
'cert' => array (
array (
'GETvar' => 'tx_oecertificates_pi1[showUid]',
'lookUpTable' => array(
'table' => 'tx_oecertificates_certificates',
'id_field' => 'uid',
'alias_field' => 'name',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
),
),
),
),
'fileName' => array (
'defaultToHTMLsuffixOnPrev' => 1,
'index' => array(
'index.html' => array(
'keyValues' => array (
'type' => 1,
),
),
),
),
);
----------------------- FUNCTIONS And Stuff -----------------
/**
* get uid of parent page
*/
function oe_get_parent_pid($id) {
$current_pid = $id;
$current_page = $GLOBALS['TSFE']->sys_page->getPage($current_pid);
if (is_array($current_page)) {
$parent_pid = $current_page['pid'];
} else {
$parent_pid = 0;
} ;
return $parent_pid;
}
function astrid_cleargif($breite,$hoehe){
return '<img src="clear.gif" alt="cleargif" height="'.$hoehe.'" width="'.$breite.'" />';
}
/**
* many thanks to my php-guru astrid. To be honest she did nothing to help me,
* even sometimes disturbed me when I tried to think, BUT:
* 1) Did this in the most charming manner (it's so important being disturbed at work!)
* 2) let me have her name for the following little function
*/
function astrid_get_sub_pid($id) {
// get pid of single view page (first subpage)
$oe_storage_pid= $this->booksCache[$relatedbook_uid_actual]['pid'];
$query = 'SELECT uid,pid,title FROM pages WHERE pid LIKE '.$id.
$this->cObj->enableFields('pages').' ORDER by sorting';
//echo $query;
$res = mysql(TYPO3_db,$query);
$row=mysql_fetch_assoc($res);
return $row["uid"];
}
TYPO3 Upgrade
shell
# Unpack
tar xvzf typo3_src-4.1.tar.gz
# Remove Symlink
rm typo3_src
# Create new Symlink
ln -s typo3_src-4.1 typo3_src
Kurze if-Bedingung
Short (Condensed) if statement
Erweiterung: ext_localconf.php
Extension: ext_localconf.php
$x = ($myvalue == 10) ? "the value is 10": "the value is not 10";
----------------------- BUGS -----------------
Built in User Basket:
Cannot use string offset as an array in ... class.tslib_feuserauth.php on line 476
typo3/sysext/cms/tslib/class.tslib_feuserauth.php
$this->setKey('ses','recs','');
this->setKey('ses','recs',array());
bugs.typo3.org/view.php?id=4367
Schlüsselworte/Keywords/mots clés: Typo3, Code, Snippets, Beispiele, Example, TS, Typoscript, Setup, TSConfig, Plugin, Erweiterung, Extension, Programmierung