Typo3 - Tipps und Tricks: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
Zeile 82: Zeile 82:
  
 
  tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines.addAttributes.P.style=
 
  tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines.addAttributes.P.style=
 +
 +
== Backend anpassen ==
 +
Content element wizard ändern
 +
 +
Dafür erweitere die php-Klasse SC_db_new_content_el und speichere diese datei unter typo3conf/ux_SC_db_new_content_el.php
 +
 +
<code>
 +
<?php
 +
class ux_SC_db_new_content_el extends SC_db_new_content_el {
 +
 
 +
 
 +
  // Modify the Wizard Array, which holds the values shown at create new
 +
  //record page:
 +
  function wizardArray() {
 +
    global $LANG,$TBE_MODULES_EXT;
 +
   
 +
    $wizardItems = array(
 +
                        "common" => array("header"=>"Typical page content"),
 +
                       
 +
                        'common_1' => array(
 +
                                            "icon"=>'../typo3conf/hos/intext_left_wi.gif',
 +
                                            'title'=>'Text with Image to the left',
 +
                                            'description'=>'A regular text element which contains a image positioned left to the text',
 +
                                            'params'=>'&defVals[tt_content][CType]=textpic&defVals[tt_content][imageorient]=26&defVals[tt_content][imagewidth]=80',
 +
                                            ),
 +
 +
                       
 +
                        "common_2" => array(
 +
                                            "icon"=>'../typo3conf/hos/fdfx_2cols.gif',
 +
                                            "title"=>'Two Column Text',
 +
                                            "description"=>'A Text with two Column',
 +
                                            'params'=>'&defVals[tt_content][CType]=fdfx_2cols_pi1'
 +
                                            ),
 +
                       
 +
 +
                        'common_3' => array(
 +
                                            "icon"=>'../typo3conf/hos/intext_right_wi.gif',
 +
                                            'title'=>'Text with big Image to the right',
 +
                                            'description'=>'A regular text element which contains a image positioned right to the text',
 +
                                            'params'=>'&defVals[tt_content][CType]=textpic&defVals[tt_content][imageorient]=25&defVals[tt_content][imagewidth]=480',
 +
                                            'tt_content_defValues' => array(
 +
                                                                            'CType' => 'textpic',
 +
                                                                            'imageorient' => 25,
 +
                                                                            'imagewidth' => 480,
 +
                                                                            )
 +
                                            ),
 +
 +
                        );
 +
   
 +
    return $wizardItems;
 +
  }
 +
}
 +
?>
 +
</code>
 +
 +
Um das ganze auch zu verwenden, mache diesen Eintrag in typo3conf/localconf.php
 +
 +
$TYPO3_CONF_VARS["BE"]["XCLASS"]["ext/cms/layout/db_new_content_el.php"] = PATH_typo3conf."class.ux_db_new_content_el.php";
 +
 +
 +
 +
  
 
== Suche ==
 
== Suche ==

Version vom 18. Mai 2006, 10:50 Uhr

mehr auf Typo3 - TS Templates und: Typo3 - Wichtige TypoScript Einstellungen

Rendering von Content Elementen

weitere Infos unter:

Typo3 - Content Elemente anpassen

Einstellungen für Bilder

Größe (maximal, minimal, Popups, Skalierung, Bildunterschriften...)

Border Attribut loswerden

config.config.disableImgBorderAttr = 1

Wichtig wenn man mit CSS arbeiten möchte.

Link to Top

Darstellung von Tabellen

Betrifft hauptsächlich das static Template content(default)

clear.gif und Absätze loswerden

content(default)

# Entfernen der <img src="clear.gif' ...>
content.headerSpace = 0|0
content.space = 0|0

externe Links

_self oder _blank, aussehen...

styles.content.links.extTarget (bei css_styled_content)

Links und Sitemap

Die Links einer eingebundenen Sitemap sind standardmäßig auf den Wert 'page' eingestellt (Typo 3.8). Das macht nur bei Framesets Sinn.

Die relevanten Setup-Werte die man ändern muß (je nach ausgewählter Sitemap):

tt_content.menu.20.1.1.target = _self
tt_content.menu.20.2. [...]


Listenpunkte und Aufzählungen

Layoutauswahl

siehe Typo3 - Rahmen (Frames) für Rahmen

und Typo3 - Backend anpassen für Header (Überschriften)

Inline CSS loswerden

Bei vielen Extensions und bei CSS Styled ImgText liegt das CSS Inline. Besser wäre ist es das CSS komplett in eigene Dateien auszulagern.

# Inline Styles auslagern
config.inlineStyle2TempFile = true

JavaScript in externe Datei auslagern

Z.B. der kleine JavaScript Schnipsel für das Blur im IE auslagern. Wie bindet man externes JavaScript ein...

siehe unter Typo3 - HTML Code optimieren

Ausgabe einer Spalte Wrappen

Beispiel:

 #Inhalt rechts
 subparts.CONTENT_RIGHT < styles.content.getRight
 #Ganze Spalte Wrappen
 subparts.CONTENT_RIGHT.wrap = <div class="content_right"> | </div>
 #Einzelnes Element Wrappen 
 subparts.CONTENT_RIGHT.renderObj.stdWrap.wrap=<div class="bordered">|</div>

Ausgabe einer Spalte Wrappen wenn nicht leer

Hier wird das content element nur mit einem div gewrapt wenn es nicht leer ist

temp.rightContent < styles.content.getRight
temp.rightContent.stdWrap {
  wrap = <div id="right-main"> | </div>
  if.isTrue.numRows < styles.content.getRight
}

(TypoWizard.com 9.1.2006)

p style="margin:0 0 0 0;" aus dem p-Tag rausnehmen

tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines.addAttributes.P.style=

Backend anpassen

Content element wizard ändern

Dafür erweitere die php-Klasse SC_db_new_content_el und speichere diese datei unter typo3conf/ux_SC_db_new_content_el.php

<?php class ux_SC_db_new_content_el extends SC_db_new_content_el {


 // Modify the Wizard Array, which holds the values shown at create new
 //record page:
 function wizardArray() {
   global $LANG,$TBE_MODULES_EXT;
   
   $wizardItems = array(
                        "common" => array("header"=>"Typical page content"),
                        
                        'common_1' => array(
                                            "icon"=>'../typo3conf/hos/intext_left_wi.gif',
                                            'title'=>'Text with Image to the left',
                                            'description'=>'A regular text element which contains a image positioned left to the text',
                                            'params'=>'&defVals[tt_content][CType]=textpic&defVals[tt_content][imageorient]=26&defVals[tt_content][imagewidth]=80',
                                            ),


                        "common_2" => array(
                                            "icon"=>'../typo3conf/hos/fdfx_2cols.gif',
                                            "title"=>'Two Column Text',
                                            "description"=>'A Text with two Column',
                                            'params'=>'&defVals[tt_content][CType]=fdfx_2cols_pi1'
                                            ),
                        
                        'common_3' => array(
                                            "icon"=>'../typo3conf/hos/intext_right_wi.gif',
                                            'title'=>'Text with big Image to the right',
                                            'description'=>'A regular text element which contains a image positioned right to the text',
                                            'params'=>'&defVals[tt_content][CType]=textpic&defVals[tt_content][imageorient]=25&defVals[tt_content][imagewidth]=480',
                                            'tt_content_defValues' => array(
                                                                            'CType' => 'textpic',
                                                                            'imageorient' => 25,
                                                                            'imagewidth' => 480,
                                                                            )
                                            ),
                        );
   
   return $wizardItems;
 }

} ?>

Um das ganze auch zu verwenden, mache diesen Eintrag in typo3conf/localconf.php

$TYPO3_CONF_VARS["BE"]["XCLASS"]["ext/cms/layout/db_new_content_el.php"] = PATH_typo3conf."class.ux_db_new_content_el.php";



Suche

Index-Suche – kein eigenes Fenster öffnen

Constants

styles.content.searchresult.resultTarget = _self
styles.content.searchresult.target = _self

Domains anlegen

Todo...

Rootline Navigation

Ein Beispiel bei dem zusätzlich Englisch (L=1) berücksichtigt wird.

temp.rootline_html= HMENU
temp.rootline_html.special = rootline
temp.rootline_html.special.range = 0|-1
temp.rootline_html.1 = TMENU
temp.rootline_html.1 {
    wrap = Sie sind hier: |
   # evt. bestimte Seiten ausblenden...
   excludeUidList =
   # Sprache mit der ID 1 (Englisch)
  target = _top
  NO {
    linkWrap= <span class="pathway">|</span>
    # optionSplit: vor erstem item kein delimiter, sonst immer einer
    allWrap = | |*| > | |*| 
    ATagBeforeWrap = 0
  }
}

# Wrap für Englisch
[globalVar = GP:L = 1]
temp.rootline_html.1.wrap = You are here: |
[global]

Mehrsprachigkeit

So baut man mehrsprachige Seiten in Typo3:

Typo3 - Mehrsprachige Seiten

Typo3 - Mehrsprachige Navigation

Spracheinstellungen

HTML-Template einbinden

siehe auch: Typo3 - HTML-Templates Beispiel (das page Objekt muß natürlich vorher definiert werden):

Im TS Template Setup:

 page.10 = TEMPLATE
 page.10{
   template = FILE
   template.file = fileadmin/templates/main.html
 
   ### Subparts ansprechen ###
   workOnSubpart = DOCUMENT_BODY
 
   # Rootline (Pathway) einfügen ###
   subparts.ROOTLINE < temp.rootline_html
   
   # Hauptinhalt
   subparts.CONTENT < layoutWrap
   subparts.CONTENT.wrap = <div class="content"> | </div>   
   
   #Inhalt rechts
   subparts.CONTENT_RIGHT < styles.content.getRight
   subparts.CONTENT_RIGHT.wrap = <div class="content"> | </div>
  
   # Rand bzw. Header
   subparts.HEADER < styles.content.getBorder
   subparts.HEADER <div class="header"> | </div>
   # subparts.HEADER < temp.flashHeader
  
   ### Hauptnavigation ###
   subparts.NAVI_LINKS < temp.navi_gLayer
  
   ### rechte Navi ###
   subparts.NAVI_RECHTS <temp.naviGRight
    
 }

Einstellungen für das Page Objekt

Verschiedene Einstellungen

statische Seiten Simulieren

Statische Seiten simulieren

config.simulateStaticDocuments = PATH_INFO
config.simulateStaticDocuments_addTitle = 30
config.simulateStaticDocuments = 1
config.admPanel = 1
config.simulateStaticDocuments_noTypeIfNoTitle = 1

.htaccess Datei für Apache Server nicht vergessen (muß nur unbenannt werden)

Einstellungen für das Admin Panel

Email

Spamschutz für Email Adressen

config.spamProtectEmailAddresses = 1
config.spamProtectEmailAddresses_atSubst = (at)

E-Mail-Absender für automatische E-Mails z.B. über Kontaktformular

E-Mail-Adresse

plugin.feadmin.dmailsubscription.email = info(at)easy-office4you.de

E-Mail-Name

plugin.feadmin.dmailsubscription.emailName = Barbara Hofbauer

Typo3 RTE - Einstellungen

RTE Absatz Formatierung einstellen

lib.parseFunc_RTE {
nonTypoTagStdWrap.encapsLines.nonWrappedTag >
nonTypoTagStdWrap.encapsLines.wrapNonWrappedLines = | 
}

HTML-Area (htmlarea) statt RTE

Mit der Extension htmlarea kann man den RTE ersetzen. Er bietet einiges mehr an Bearbeitungsfunktionen (wenn man die denn will) aber vor allem läuft er auch auf Mozilla, Firefox, etc. Browsern.

htmlarea anpassen

Die Möglichkeiten des htmlarea Editors sind oft zuviel des Guten. Die meisten Anpassungen des RTE funktionieren auch im htmlarea. Beispiele:

Minimale Funktionalität

Im Page Setup:

RTE.default {
	## Toolbar options applicable to all RTE's
	## The TCA configuration may add buttons to the toolbar
	showButtons =  bold,italic,undo,redo,about
}
    1. front end RTE configuration for the general public (htmlArea RTE only)

RTE.default.FE < RTE.default

Header Image austauschen

Typo3 - Header Image austauschen