Zum Inhalt springen

listendarstellung mit templ ohne wraps?

Erstellt am 13. August 2004 · 1 Antwort · letzte Antwort am 21. August 2004

Tags: Templates & Layouts, Datenbank, Frage

lixx ·

hi,

icon_rolleyes.gif kann man mit typoscript templates erstellen, die z.b. innerhalb vom DOKUMENT_BODY ein weiteres subtemplate enthalten um damit eine listendarstellung zu erzeugen ohne wraps innerhalb von typoscript zu gebrauchen? der sinn ist der, dass man keinen html-code im typoscript benötigt.

gedacht ist folgendes:

<!-- ###DOKUMENT_BODY### begin -->
      <table>
         <tr>
            <td></td>
         </tr>
   <!-- ###LIST_VIEW### begin -->
         <tr>
            <td>###TITLE_1### - ###TITLE_2###</td>
         </tr>
   <!-- ###LIST_VIEW### end -->
         <tr>
            <td></td>
         </tr>
      </table>
<!-- ###DOKUMENT_BODY### end -->

das sollte der html-code sein.
danach möchte ich per typoscript eine db-tabelle auslesen...

temp = CONTENT
temp {
  table = tx_adressen
  select.pidInList.field =  pages
  renderObj = TEXT
  renderObj {
    field =  title_1
    split {
      token = ,
      cObjNum = 1
      1.current = 1
    }
  }
}

...und die inhalte der felder "title_1" und "title_2" bei ###LIST_VIEW### mit den marks ###TITLE_1### und ###TITLE_2### ersetzen.

hoffe auf eure hilfe und lg lixxus

lixx ·

holla!

hab's nun selbst herausgefunden! 😃 also, wenn's euch interessiert. das template dazu ist mit einer TOPVIEW-, für den listentitel, mit einer LISTVIEW-, für die listenansicht und einer BOTTOMVIEW-subpart eingerichtet.

plugin.tx_spdirectory_pi1 >
plugin.tx_spdirectory_pi1 = COA
plugin.tx_spdirectory_pi1.1 = TEMPLATE
plugin.tx_spdirectory_pi1.1 {
  template = FILE
  template.file = fileadmin/_tmpl/test.tmpl
  workOnSubpart = TOPVIEW
}

... erzeugt den listen titel

plugin.tx_spdirectory_pi1.2 = CONTENT
plugin.tx_spdirectory_pi1.2 {
    table = tt_address
    select {
      pidInList.field = pages
      where = hidden=0
      orderBy = name
      max = 10
    }
    renderObj = TEMPLATE
    renderObj {
      template = FILE
      template.file = fileadmin/_tmpl/test.tmpl
      workOnSubpart = LISTVIEW
      marks {
        TITLE = TEXT
        TITLE.field = title
        LNAME = TEXT
        LNAME.field = name
        ... usw.
      }
    }
  }
}

... erzeugt die liste selbst

plugin.tx_spdirectory_pi1.3 = TEMPLATE
plugin.tx_spdirectory_pi1.3 {
  template = FILE
  template.file = fileadmin/_tmpl/test.tmpl
  workOnSubpart = BOTTOMVIEW
}

... erzeugt den listen unterteil.

das ist echt geil! #giggle#