Zum Inhalt springen

Kompletten Code zum Buch

Erstellt am 25. Mai 2006 · 4 Antworten · letzte Antwort am 16. März 2009

Tags: Frage

Dingens ·

Moin zusammen,
bin völlig neu hier und hab auch gleich eine Frage.
Seit Tagen arbeite ich das Buch Praxis Typo3 von Robert Meyer duch.
Nun hab ich mir beim Ausprobieren den Code zerschossen.
Gibts diesen irgendwo komplett, also an einem Stück?
Im Buch sind zwar wunderbare Zeilennummern zu sehen, in Typo3 fehlen diese allerdings, sodaß die schnipselweise Überprüfung des Codes nicht möglich ist.

Wer weiß hier Rat?

Gruß
Dingens

hijacker ·

Hallo, den hab ich auch mal komplett gebraucht:

# Allgemeine TypoScript-Konfigurationen
config.linkVars = L
config.sys_language_uid = 0
config.language = de
config.spamProtectEmailAddresses = 1
config.index_enable = 1
config.index_externals = 1

config.simulateStaticDocuments = 1
config.simulateStaticDocuments_noTypeIfNoTitle = 1

#page.config.metaCharset = utf-8

page = PAGE
page {
page.typeNum=0
# Allgemeine Seiteneigenschaften setzen
page.bodyTag = <body bgcolor="#FFFFFF" topmargin="0" leftmargin="0">
page.meta.AUTHOR = Robert Meyer
page.meta.DESCRIPTION = Hier steht eine Beschreibung
stylesheet = fileadmin/style.css
# Die Designvorlage integrieren
10 = TEMPLATE
10.template = FILE
10.template.file = fileadmin/vorlage.html
10.workOnSubpart = DOKUMENT
10.marks {
# Den Platzhalter DATUM ansprechen
DATUM = TEXT
DATUM.data = date : d.m.Y
# Das Logo einlesen
LOGO = IMAGE
LOGO.file = fileadmin/images/logo.jpg
LOGO.file.width = 178
# Den Trailer dynamisch ansprechen
TRAILER = IMAGE
TRAILER.file = GIFBUILDER
TRAILER.file {
XY = 759, 99
backColor = #FFFFFF
# Das Hintergrundbild einlesen
10 = IMAGE
10.file.import = uploads/media/
10.file.import.data = levelmedia:-1, slide
10.file.import.listNum = 0
10.file.width = 759
10.offset = 0, -150
# Den Verlauf einarbeiten
20 = IMAGE
20.file = GIFBUILDER
20.file.backColor = #FFFFFF
20.file.XY = 759,99
20.mask = fileadmin/images/mask.jpg
# Text auf den Trailer rendern
30 = TEXT
30.text.field = subtitle // title
30.fontFile = fileadmin/fonts/verdana.ttf
30.fontSize = 24
30.fontColor = #364497
30.niceText = 1
30.offset = 10, 85
}
# Das Textmenü oben erstellen
MENU_OBEN = HMENU
MENU_OBEN {
special = directory
special.value = 4
1 = TMENU
1.NO = 1
1.NO.linkWrap = | ||*| | ||*| |
}
# Den Platzhalter KLICKPFAD ansprechen
KLICKPFAD = COA
KLICKPFAD {
# Der vorgeschaltete Text
10 = TEXT
10.value = Sie befinden sich hier: 
# Den Klickpfad an Position 20 darstellen
20 = HMENU
20 {
special = rootline
special.range = 2|-1
1 = TMENU
1.NO = 1
1.NO.linkWrap = | / 
}
}
# Inhalt ausgeben
INHALT = CONTENT
INHALT {
table = tt_content
select.orderBy = sorting
select.where = colPos = 0
select.languageField = sys_language_uid
}
# Inhalte in der rechten Spalte ausgeben
RECHTS = COA
RECHTS.10 = CONTENT
RECHTS.10 {
table = tt_content
select.where = colPos = 2
select.orderBy = sorting
}
RECHTS.20 = CONTENT
RECHTS.20 {
table = tt_content
select.orderBy = sorting
# Inhalte werden von der Seite mit der ID 18 genommen.
select.pidInList = 18
}


# Suchformular im Platzhalter anzeigen
SUCHE < tt_content.search.30
SUCHE {
target = _self
redirect = 9
badMess = Bitte geben Sie ein Suchwort an!
layout = ###FIELD###
stdWrap.wrap >
dataArray.10 {
label =
type = *sword = input, 5, 30
}
dataArray.20 {
valueArray >
type = scols = hidden
value = pages.title-subtitle-keywords-description:tt_content.header-bodytext-imagecaption
}
image = IMAGE
image.file = GIFBUILDER
image.file {
XY = 20,15
backColor = silver
10 = TEXT
10.text = GO
10.fontFile = fileadmin/fonts/verdana.ttf
10.fontColor = black
10.fontSite = 11
10.niceText = 1
10.offset = 2, 13
}
}

# Den Sprachwechsel als Textlink erzeugen
SPRACHE = TEXT
SPRACHE {
field = uid
wrap = <a href="index.php?id=|&L=1">English</a>
} 

# Link zur Druckversion erzeugen
DRUCKVERSION = TEXT
DRUCKVERSION {
field = uid
wrap = <a href="index.php?id=|&L=0&type=1" target="_new">Druckversion</a>
}

# Das grafische Menü erstellen
MENU_LINKS = HMENU
MENU_LINKS {
wrap = <img src="fileadmin/images/linie_weiss.gif" width="178" height="1" alt="" />|
special = directory
special.value = 3
entryLevel = 1
1 = GMENU
1.NO = 1
1.NO {
wrap = |
XY = 178, 24+[16.h]
backColor = #364497
# Text auf den Menüpunkt rendern
10 = TEXT
10.text.field = title
10.text.listNum = 0
10.text.listNum.splitChar = |
10.fontColor = #FFFFFF
10.fontFile = fileadmin/fonts/verdana.ttf
10.fontSize = 12
10.niceText = 1
10.offset = 14, 16
# Eine ggf. vorhandene zweite Textzeile
15 < .10
15.text.listNum = 1
15.offset = 14, 32
# Hilfsebene zur Berechnung der Höhe von Menüpunkten
16 < .10
16.text.case = upper
16.text.listNum = 1
16.fontSize = 22
16.offset = 1000,1000
# Eine weisse Linie erzeugen
20 = IMAGE
20.file = GIFBUILDER
20.file {
XY = 178, 1
backColor = #FFFFFF
}
20.offset = 0, 23+[16.h]
}
# Einen RollOver-Zustand beschreiben
1.RO < .1.NO
1.RO.backColor = #061467
# Die zweite Ebene als Kopie der ersten Ebene beschreiben
2 < .1
2.NO {
backColor = #D3E2F9
10.fontColor = #061467
10.fontSize = 11
}
2.RO < .2.NO
2.RO.backColor = #C1D5F4
}


}
}


# Druckansicht
druckversion = PAGE
druckversion {
typeNum = 1
10 = CONTENT
10.table = tt_content
10.select.orderBy = sorting
10.select.colPos = 0
10.select.languageField = sys_language_uid
}


# Die Überschrift neu formatieren
lib.stdheader >
lib.stdheader = CASE
lib.stdheader {
key.field = header_layout
default = TEXT
default.field = header
default.wrap = <h1>|</h1>

2 = IMAGE
2.file = GIFBUILDER
2.file {
XY = [10.w]+10, 20
backColor = #FFFFFF
10 = TEXT
10.text.field = header
10.fontFile = fileadmin/fonts/verdana.ttf
10.fontColor = #061467
10.fontSize = 15
10.niceText = 1
10.offset = 2, 18
}
wrap = |
}
# Inhaltstyp "Normaler Text" anpassen
tt_content.text.20 {
textStyle >
wrap = <p>|</p>
}
# Die Sitemap von einem Ausgangspunkt erstellen lassen
tt_content.menu.20.2 {
special = directory
special.value.field = pages
}
# Das Suchformular anpassen
tt_content.search.30 {
target = _self
badMess = Bitte füllen Sie alle erforderlichen Felder aus:
dataArray.10 {
label = Ihre Suche:
type = *sword = input, 15, 30
}
dataArray.20 {
valueArray >
type = scols = hidden
value = pages.title-subtitle-keywords-description:tt_content.header-bodytext-imagecaption
}
image = IMAGE
image.file = GIFBUILDER
image.file {
XY = 50,20
backColor = silver
10 = TEXT
10.text = SUCHE
10.fontFile = fileadmin/fonts/verdana.ttf
10.fontColor = black
10.fontSite = 11
10.niceText = 1
10.offset = 2, 15
}
}
# Das Suchergebnis anpassen
tt_content.search.20 {
layout.10 {
value = Ergebnisse auf dieser Seite: ###RANGELOW### bis ###RANGEHIGH### von ###TOTAL###
fontTag >
wrap = <td width="95%" bgcolor="silver"><font face="verdana" size="”2”"><b>|</b></font></td>
}
layout.20 {
value = ###PREV### ###NEXT###
fontTag >
wrap = <td bgcolor="silver"><font face="verdana" size="2"><b>|</b></font></td>
}
renderObj.10 {
textStyle >
fontTag >
wrap = <font face="”verdana”" size="”2”"><b>|</b></font>
typolink.target = _self
}
renderObj.20 {
stdWrap.textStyle >
stdWrap.wrap = <tr><td><font face="Verdana" size="1" color="navy"> |</font></td></tr>
stdWrap.crop = 200 | [...]
}
noResultObj >
noResultObj = TEXT
noResultObj {
value = Kein Ergebniss gefunden!
wrap = <font face="Verdana" size="2"><b>|</b></font>
}
next.value = Weiter
prev.value = Zurück
target = _self
range = 10
}

# Login-Formular für Webseiten-Benutzer
tt_content.login.20 {
hiddenFields.pid.value = 19
dataArray.10.label = Benutzername:
dataArray.20.label = Passwort:
}

# Parameter für das eigene Mitarbeiter-Plugin
plugin.user_rmmitarbeiter_pi1 {
testObjekt = IMAGE
testObjekt.file = GIFBUILDER
testObjekt.file {
XY = 100,100
backColor = red
}
# Pfad zur Designvorlage als Parameter angeben
templateFile = fileadmin/mitarbeiter.html

# So soll ein Foto eines Mitarbeiters formatiert werden.
bild = IMAGE
bild.file = GIFBUILDER
bild.file {
XY = [10.w]+2, [10.h]+2
backColor = black
10 = IMAGE
# Der Pfad zum Bild wird später dynamisch ersetzt.
10.file = unbekannt
10.file.width = 70
10.offset = 1,1
}
# Dieses Bild soll angezeigt werden, wenn kein Foto vorhanden ist.
bild_default = IMAGE
bild_default.file = GIFBUILDER
bild_default.file {
XY = 152, 50
backColor = white
10 = TEXT
10.text = N/A
10.fontFile = fileadmin/fonts/verdana.ttf
10.fontSize = 20
10.fontColor = black
10.niceText = 1
10.offset = 30,25
}
}

# Mehrsprachigkeit
[globalVar = GP:L=1]
config.sys_language_uid = 1
config.language = en
page.10.marks.SPRACHE.wrap = <a href="index.php?id=|&L=0">German</a>
page.10.marks.DRUCKVERSION.wrap = <a href="index.php?id=|&L=1&type=1" target="_new">Print</a>
tt_content.login.20.dataArray.10.label = Username:
tt_content.login.20.dataArray.20.label = Password:
}
[global]

# Eingeloggter Benutzer
[loginUser = *]
tt_content.login.20 {
dataArray.10.label = Sie sind als Benutzer <b>tandem</b> eingeloggt
image = IMAGE
image.file = GIFBUILDER
image.file {
XY = 100, 20
backColor = red
10 = TEXT
10.text = Logout
10.fontSize = 15
10.fontColor = white
10.fontFile = fileadmin/fonts/verdanab.ttf
10.niceText = 1
10.offset = 1, 16
}
}
[global]

# In Druckansicht keine grafische Überschrift
[globalVar = GP:type=1]
lib.stdheader.1 >
[global]


[globalVar = GP:L=1]
config.sys_language_uid = 1
config.language = en
page.10.marks.SPRACHE.wrap = <a href="index.php?id=|&L=0">German</a>
tt_content.login.20.dataArray.10.label = Username:
tt_content.login.20.dataArray.20.label = Password:
[global]

gruß

Dingens ·

Aaahhhhh, super,
besten Dank.
Jetzt brauch ich nur noch die eine Stelle zu finden,
wo ich die Klammern verschoben hab. #paralyzed#

Gruß
Dingens

NickD ·

ich habe den code zur druckansicht 1 zu 1 übernommen und er funkst einfach nicht #angry# *zum verrückt werden, wie lange man sich daran aufhalten kann*

vistree ·

Hallo,
ich bin auch total neu und habe hier eine bestehende Typo3-Installation, die ich ab jetzt übernehmen soll. Ich blicke da aber überhaupt nicht durch, da das Konstrukt der Seite total den Beispielen wiederspricht, dei man sonst so findet.
Ich würde gerne auf der Seite ein Suchfeld integrieren, so wie dies ja im gezeigten Beispiel angedeutet wird. Wie übertrage ich das auf meinen Code?
Hier der Teil aus dem verwendeten Template (es gibt keine separate HTML-Template-Datei!):
Constants

plugin.alt.print.file.stylesheet = fileadmin/css/print.css
plugin.alt.print.file.template = fileadmin/css/print.tmpl

plugin.tt_news.file.templateFile = fileadmin/css/news.tmpl
plugin.tt_news.pid_list = 48
plugin.tt_news.limit = 10

plugin.wt_spamshield.enable.standardMailform = 1
plugin.wt_spamshield.redirect.standardMailform = http://www.meineseite.de/index.php?id=267

##
#####searchbox
# Searchword in value
lib.value = COA_INT
lib.value {
   10 = TEXT
   10.data = GPvar:tx_indexedsearch|sword
   10.htmlSpecialChars = 1
   10.if.isTrue.data = GPvar:tx_indexedsearch|sword

   20 = TEXT
   20.value = Suche
   20.if.isFalse.data = GPvar:tx_indexedsearch|sword
}

# Show Form with Search input
lib_search = COA
lib_search {
   wrap = <div>|</div>

   10 = TEXT
   10 {
      wrap = <form action="|" method="post" class="search search_form">
      typolink.parameter = 268
      typolink.returnLast = url
   }
   20 < lib.value
   20 {
   wrap = <input type="text" name="tx_indexedsearch[sword]" value="|"
      onfocus="if(this.value=='Suche') this.value='';"
      onblur="if(this.value=='') this.value='Suche';"
      class="search search_input" />
   }
   30 = TEXT
   30 {
      value = <input type="submit" value="go" class="search search_submit" />
   }
   40 = TEXT
   40.value = </form>
}


##


plugin.tx_directmail_pi1.siteUrl = http://www.meineunterseite.de
plugin.feadmin.dmailsubscription.pid = 34
plugin.feadmin.dmailsubscription.file.templateFile = fileadmin/css/newsletter.tmpl
plugin.feadmin.dmailsubscription.email = my@email.de
plugin.feadmin.dmailsubscription.emailName = Newsletter Geothermie
plugin.feadmin.dmailsubscription.wrap2 = <p> | </p>
plugin.feadmin.dmailsubscription.wrap1 = <h2> | </h2>
PAGE_TARGET = _self
styles.content.loginform.pid = 100

Setup

config{
   admPanel = 0
   doctype = xhtml_trans
   xhtml_cleaning = all
   xmlprologue = none
   extTarget = _blank
   page_target = _self
   target = _self
   htmlTag_langKey = de
 #  spamProtectEmailAddresses = 3
 #  spamProtectEmailAddresses_atSubst = @
   language = de
   locale_all = de_DE
   stat_excludeBEuserHits=1
   stat_typeNumList=0,1
   stat = 1
   stat_apache = 1
   stat_apache_logfile = log.txt
}


#plugin.tx_cssstyledcontent._CSS_DEFAULT_STYLE >
#lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.addAttributes.P > 

#####menu
temp.menu = HMENU
temp.menu.1 = TMENU
temp.menu{

      1.expAll=0
      1.wrap = <ul class="nav">|</ul>
      1.NO = 1
      1.NO.allWrap = <li >|</li>
      1.CURIFSUB=1
      1.CURIFSUB.allWrap = <li>|
      1.CURIFSUB.ATagParams = class="current"
      1.ACTIFSUB=1
      1.ACTIFSUB.ATagParams = class="current"
      1.ACTIFSUB.allWrap = <li>|
      1.ACT = 1
      1.ACT.ATagParams = class="current"
      1.ACT.linkWrap = <li >|</li>

      2 = TMENU
      2.expAll=0
      2.wrap = <ul id="subnav">|</ul>
      2.NO = 1
      2.NO.allWrap = <li>|</li>
      2.ACT = 1
      2.ACT.ATagParams = class="current"
      2.ACT.allWrap = <li >|</li>
      
      3 = TMENU
      3.expAll=0
      3.wrap = <ul id="subnav2">|</ul>
      3.NO = 1
      3.NO.allWrap = <li>|</li>
      3.ACT = 1
      3.ACT.ATagParams = class="current"
      3.ACT.allWrap = <li >|</li>
}



#####printlink

temp.PRINT = TEXT
temp.PRINT.value = Seite drucken
temp.PRINT.postUserFunc = tx_make_printlink
temp.PRINT.postUserFunc.include_post_vars = 1
temp.PRINT.postUserFunc.target = _blank
temp.PRINT.postUserFunc.popup = 1
temp.PRINT.postUserFunc.windowparams = resizable=yes,toolbar=no,scrollbars=yes,menubar=no,width=620,height=500
temp.PRINT.postUserFunc.windowname = printwindow




#####page

# RSS
page.headerData.500 = TEXT
page.headerData.500.value = <link rel="alternate" type="application/rss+xml" title="RSS-Feed" href="http://www.meineseite.de/index.php?id=49&type=100" />
xmlnews = PAGE
xmlnews {
  typeNum = 100
  10 >
  10 < plugin.tt_news
  10.pid_list >
  10.pid_list = {$plugin.tt_news.pid_list}
  10.singlePid = {$plugin.tt_news.singlePid}
  10.defaultCode = XML
  config {
    disableAllHeaderCode = 1
    additionalHeaders = Content-type:text/xml
    no_cache = 1
    xhtml_cleaning = 0
  }
}


page.10.marks.SEARCH < lib_search

page=PAGE



page {
   typeNum=0
   target=_self
   config.admPanel = 1
   bodyTag = <!-- page body --> 
   1 = TEXT
   1.dataWrap = <body id="{field:alias}" />
   includeCSS {
      file1 = fileadmin/css/csc-styles.css
      file2 = fileadmin/css/geothermie.css
   }
   5 = TEXT
   5.value = <div id="messlatte"></div>
   10 = COA
   10{
	10 < temp.menu
	
	10.wrap = <div id="menu">|</div>

	15= COA
	15 {
		20 = COA
		20{
			10 = CONTENT
	      		10{
			table = tt_content
                 	select {
                    		pidInList = this
                    		orderBy = sorting
                    		where=colPos=0
                    		languageField=sys_language_uid
                	}
	      		}
	      		20 < temp.PRINT
	      		20.wrap = <div id="print">|</div>
	      		22.wrap = <link rel="alternate" type="application/rss+xml" title="RSS-Feed" href="http://www.meineseite.de/index.php?id=49&type=100" />

		}
		20.wrap = <div id="middle_col">|</div>
	
		30 = COA
		30{
			10 = CONTENT
	      		10{
			table = tt_content
                 	select {
                    		pidInList = this
                    		orderBy = sorting
                    		where=colPos=2
                    		languageField=sys_language_uid
                	}
	      		}
		}
		30.wrap = <div id="right_col">|</div>

	}
#	15.wrap = <div id="content2">|</div>	
   }
   10.wrap = <div id="content">|</div>


##########   
# Suchformular im Platzhalter anzeigen
SUCHE < tt_content.search.30
SUCHE {
target = _self
redirect = 9
badMess = Bitte geben Sie ein Suchwort an!
layout = ###FIELD###
stdWrap.wrap >
dataArray.10 {
label =
type = *sword = input, 5, 30
}
dataArray.20 {
valueArray >
type = scols = hidden
value = pages.title-subtitle-keywords-description:tt_content.header-bodytext-imagecaption
}
image = IMAGE
image.file = GIFBUILDER
image.file {
XY = 20,15
backColor = silver
10 = TEXT
10.text = GO
10.fontFile = fileadmin/fonts/verdana.ttf
10.fontColor = black
10.fontSite = 11
10.niceText = 1
10.offset = 2, 13
}
}
########### 


   15 = TEXT
   15.value = <div id="messlatte2"></div>
}


plugin.tt_news.displayList.date_stdWrap.strftime = %d.%m.%y
plugin.tt_news._LOCAL_LANG.de.more = mehr

plugin.tt_news {
 general_stdWrap {
 parseFunc.nonTypoTagStdWrap.encapsLines {
 nonWrappedTag =
}
}
} 
plugin.tt_news.displayList.subheader_stdWrap.wrap = <span class="bodytext">|</span>
plugin.tt_news.displaySingle.subheader_stdWrap.wrap = <p class="bodytext"><b>|</b></p>


#tt_content.table.20.innerStdWrap.wrap = |
#tt_content.table.20.innerStdWrap.wrap >

tt_content.mailform.20.badMess = Bitte füllen Sie folgende Felder vollständig aus:


alt_print.10.marks.CONTENT = CONTENT
alt_print.10.marks.CONTENT.table = tt_content
alt_print.10.marks.CONTENT.select.orderBy = sorting
alt_print.10.marks.CONTENT.select.where = colPos=0
alt_print.10.marks.CONTENT.select.languageField = sys_language_uid

alt_print.10.marks.CONTENT2 = CONTENT
alt_print.10.marks.CONTENT2.table = tt_content
alt_print.10.marks.CONTENT2.select.orderBy = sorting
alt_print.10.marks.CONTENT2.select.where = colPos=2
alt_print.10.marks.CONTENT2.select.languageField = sys_language_uid
plugin.tt_news.displayList.subheader_stdWrap.crop = 150 | ... | 1

Ich habe versucht, das mal in dem Bereich zwischen den
#############
einzufügen.
Auf meiner Zielseite wird diese Änderung aber ignoriert - man sieht überhaupt nichst.

Kann mir hier jemand weiterhelfen?

Gruß

vistree