Zum Inhalt springen

Pagetitle in Site einbinden

Erstellt am 18. November 2004 · 7 Antworten · letzte Antwort am 27. Dezember 2004

Tags: Frage

klayman ·

Hallo,

ich würde gerne den Pagetitle des Headers in meine Site einbinden so dass er immer als Überschrift mit <h1>|</h1> erscheint. Mein Template hat eine "Main-Section" in die die content-elemente reingepackt werden, davor hätte ich eben ganz gerne noch den Titel der Page wie er z.B. im Menu erscheint... Ich nutze folgenden Code:

# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {

    # Feeding the content from the Auto-parser to the TEMPLATE cObject:
  template =< plugin.tx_automaketemplate_pi1

    # Select only the content between the <body>-tags
  workOnSubpart = DOCUMENT_BODY 

    # Substitute the ###menu_1### subpart with some example content:
  subparts.menu_1 < temp.menu_1
 
    # Substitute the ###main### subpart with some content:
  subparts.main < styles.content.get

    # Substitute the ###linklist### subpart with some content:
  subparts.linklist < styles.content.getBorder
}

# Default PAGE object:
page = PAGE
page.typeNum = 0
 
# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate
 
# Copying the content from TEMPLATE for <head>-section:
page.headerData.10  < temp.headTemplate

Gibt es jetzt eine Möglichkeit á la page.10 < temp.pageheader mit ein paar nachfolgenden wraps?

Vielen Dank,
Matthias

klayman ·

unfortunately hat das nicht geholfen 😢
ich nutze AutoTemplateParser und CSS_Styled_Content für meine Site, falls das relevant ist. Deinen Code hab ich (mit <h1>|</h1> wraps) direkt über die Zeile gesetzt in der Page.10 mit temp.mainTemplate gefüllt wird. Nach wie vor sieht alles ganz normal aus, allerdings ohne die gewünschte Überschrift.
Hat noch jemand eine Idee?

Danke,
Matthias

klayman ·

soderle, ich hab jetzt nochmal verschiedene Reihenfolgen und Positionen durchexerciert, leider bekomme ich im Quelltext der generierten HTML-Seite nur die gewrappten Tags angezeigt, der Titel fehlt. Stimmt denn der Name der Variablen so (--> title)?

Gruß,
Matthias

birgitr ·
#subpart oder marks wie das DIV in Deinem HTML-Template benannt
 subparts.HEADER = TEXT
   subparts.HEADER {
       field = title
       wrap = <H1>|</H1>
   }
birgitr ·

formvollendeter unter 3.7.0

subparts.HEADER = COA
subparts.HEADER.10 = TEXT
   subparts.HEADER.10 { 
       field = title 
       wrap = <H1>|</H1>
   }
klayman ·

Hallo,

hat etwas länger gedauert, aber leider ist es mir noch immer nicht gelungen den Titel der Seite in den HTML-Code einzubinden. Auch Birgits Beispiel war leider erfolglos. Vielleicht könnte sich jemand mal mein Template anschauen und mir einen Tipp geben.

Vielen Dank,
Matthias

# Disable CSS-Crap from extensions in my sites...
plugin.tx_eeblog_pi1._CSS_DEFAULT_STYLE =  
page.stylesheet = fileadmin/template/main/phenom.css



#-------------------------------------------------------------------------------
# Configuring the Auto-Parser:
plugin.tx_automaketemplate_pi1 {
    # Read the template file:
  content = FILE
  content.file = fileadmin/template/main/phenom.html
 
    # Here we define which elements in the HTML that 
    # should be wrapped in subpart-comments:
  elements {
    BODY.all = 1
    BODY.all.subpartMarker = DOCUMENT_BODY
 
    HEAD.all = 1
    HEAD.all.subpartMarker = DOCUMENT_HEADER
    HEAD.rmTagSections = title
 
    DIV.all = 1
  }
    # Prefix all relative paths with this value:
  relPathPrefix = fileadmin/template/main/
}


#-------------------------------------------------------------------------------
# Menu 1 cObject
temp.menu_1 = HMENU
  # First level menu-object, textual
temp.menu_1.1 = TMENU
temp.menu_1.1 {
    # Normal state properties
  NO.ATagParams = class="menu1-level1-no"
    # Enable active state and set properties:
  ACT = 1
  ACT.ATagParams = class="menu1-level1-act"
  SPC = 1
  SPC.doNotShowLink = 0
  SPC.doNotLinkIt = 1
  SPC.allWrap = <h3> | </h3>
}
  # Second level menu-object, textual
temp.menu_1.2 = TMENU
temp.menu_1.2 {
    # Normal state properties
  NO.ATagParams = class="menu1-level2-no"
    # Enable active state and set properties:
  ACT = 1
  ACT.ATagParams = class="menu1-level2-act"
  SPC = 1
  SPC.doNotShowLink = 0
  SPC.doNotLinkIt = 1
  SPC.allWrap = <h3> | </h3>
}

 # Third level menu-object, textual
temp.menu_1.3 = TMENU
temp.menu_1.3 {
    # Normal state properties
  NO.ATagParams = class="menu1-level3-no"
    # Enable active state and set properties:
  ACT = 1
  ACT.ATagParams = class="menu1-level3-act"
  SPC = 1
  SPC.doNotShowLink = 0
  SPC.doNotLinkIt = 1
  SPC.allWrap = <h3> | </h3>
}



#-------------------------------------------------------------------------------
# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {

    # Feeding the content from the Auto-parser to the TEMPLATE cObject:
  template =< plugin.tx_automaketemplate_pi1

    # Select only the content between the <body>-tags
  workOnSubpart = DOCUMENT_BODY

    # Substitute the ###menu_1### subpart with some example content:
  subparts.menu_1 < temp.menu_1
 
    # Substitute the ###main### subpart with some content:
  subparts.main < styles.content.get

    # Substitute the ###linklist### subpart with some content:
  subparts.linklist < styles.content.getBorder
}


#------------------------------------------------------------------------------- 
# Main TEMPLATE cObject for the HEAD
temp.headTemplate = TEMPLATE
temp.headTemplate {
    # Feeding the content from the Auto-parser to the TEMPLATE cObject:
  template =< plugin.tx_automaketemplate_pi1
    # Select only the content between the <head>-tags
  workOnSubpart = DOCUMENT_HEADER
}

#-------------------------------------------------------------------------------
  subparts.HEADER = COA 
  subparts.HEADER.10 = TEXT 
     subparts.HEADER.10 { 
         field = title 
         wrap = <H1>|</H1> 
     }
#-------------------------------------------------------------------------------
# Default PAGE object:
page = PAGE
page.typeNum = 0

#page.5 = TEXT
#page.5.text.field = title
#page.5.wrap = <h1> | </h1>
 
# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate
 
# Copying the content from TEMPLATE for <head>-section:
page.headerData.10  < temp.headTemplate
birgitr ·

Denkfehler:
subparts.HEADER
gehört zu mainTemplate

es beschreibt das subpart HEADER innerhalb von <body> und </body> in Deinem HTML-Template;die Stelle, an der Du den Seitentitel als Text ausgeben willst

field = title sagt an, woher im TS der entsprechende Text kommen soll

holt nichts aus <header> in der HTML-Datei, sondern <title> in <header> bekommt den Inhalt ebenfalls aus Typo3 zugewiesen

aus dem Modul Seitentitel bearbeiten, d. h. dem Feld Seitentitel (deshalb field= title)

Diesen Seitentitel legst Du genau dort an

also:
Du bleibst im mainTemplate
innerhalb von workOnSubpart = DOCUMENT_BODY

subparts.HEADER kann auch heißen
subparts.OMA
nur muß es in Deinem HTML-Template genauso heißen