Avatar billede jensgram Nybegynder
25. april 2006 - 22:50 Der er 1 kommentar og
1 løsning

Typo3 skabelon viser ikke CONTENT

Hej Eksperter

Jeg har et problem med en skabelon til typo3 - de enkelte siders indhold bliver ikke indsat i "Normal" / "id=content" - elementet.

# 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 dynamic menu:
  subparts.menu_1 < temp.menu_1

    # Substitute the ###content### subpart with some example content:
  subparts.content < styles.content.get
}


Det er nok sidste linie, der er interessant, men denne opsætning virker fint i andre sammenhænge.

I mine endelige sider bliver kildekoden:

<td id="content"><!--###content### begin --><!-- Indhold --><!--###content### end --></td>

... hvilket tyder på, at noget af skabelonen er god nok, da HTML-filen blot indeholder:


<td id="content"><!-- Indhold --></td>


CONTENT-elementet er altså fundet, men sidens elementer bliver ikke indsat. Sikkert meget dårligt formuleret spørgsmål, men jeg kan virkelig ikke gennemskue fejlen.

- Jens
Avatar billede jensgram Nybegynder
25. april 2006 - 22:53 #1
Hele T3 setup'en:



# 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.allWrap = <div class="menu1-level1-no">&bull;&nbsp; | </div>
    # Enable active state and set properties:
  ACT = 1
  ACT.allWrap = <div class="menu1-level1-act">&bull;&nbsp; | </div>
}
  # Second level menu-object, textual
temp.menu_1.2 = TMENU
temp.menu_1.2 {
    # Normal state properties
  NO.allWrap = <div class="menu1-level2-no">&middot;&nbsp; | </div>
    # Enable active state and set properties:
  ACT = 1
  ACT.allWrap = <div class="menu1-level2-act">&middot;&nbsp; | </div>
}


# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
    # Read the template file:
  content = FILE
  content.file = fileadmin/templates/s.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

    TD.all = 1
  }

    # Prefix all relative paths with this value:
  relPathPrefix = fileadmin/templates/
}


# 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 dynamic menu:
  subparts.menu_1 < temp.menu_1

    # Substitute the ###content### subpart with some example content:
  subparts.content < styles.content.get
}


# 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
}




# 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
Avatar billede jensgram Nybegynder
26. april 2006 - 14:39 #2
JÆS SIR!

http://typo3.org/documentation/document-library/tutorials/doc_tut_templselect/current/view/1/3/

However the first thing you have to do is to install the extension, "css_styled_content":

Just click the Install button and press the accept-button on the next page.

(NOTICE: At the time of this writing (january 2004) the "CSS styled content" plugin is NOT complete! It is on the top-3 of Kaspers todo list and is scheduled for development immediately after the snowboard tour.)

Back to the template: In the Template module, click this link:

Then you should see the "CSS Styled Content" static file available in the box "Include Static (from extensions)":
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester