TYPO3 Agency - coding, design and website development

Číslované obsahové prvky


Potrebujeme zobraziť obsahové prvky stránky tak, aby boli podľa poradia očíslované.
Budeme zobrazovať poradové číslo, nadpis a text.


Spravíme to pomocou Typoscriptu použitím objektu LOAD_REGISTER.


page.10 < styles.content.get
page.10 {
  wrap = <dl>|</dl>
  renderObj = COA
  renderObj {
    10.counter {
      cObject = TEXT
      cObject {
        data = register:counter
        wrap = |+1
      prioriCalc = intval
    20 = TEXT
    20 {
      field = header
      insertData = 1
      wrap = <dt>{register:counter}. |<dt>
    30 = TEXT
    30 {
      field = bodytext
      parseFunc =< lib.parseFunc_RTE
      wrap = <dd>|</dd>

Výsledok HTML

<dt>1.&nbsp;What is an API?</dt>
<p>An Application Programming Interface, or API, defines the classes,methods...</p>
<p>APIs can be procedural or object-oriented. With a procedural API youcall functions...</p>
<p>When writing PHP applications that need to connect to the MySQLserver there are several...</p>
<dt>2.&nbsp;What is a Connector?</dt>
<p>In the MySQL documentation, the term <i class="emphasis">connector</i>refers...</p>
<p>If your PHP application needs to communicate with a database serveryou will need to write...</p>
<dt>3.&nbsp;What is a Driver?</dt>
<p>A driver is a piece of software designed to communicate with aspecific type...</p>
<p>By way of an example, the PHPData Objects (PDO) database abstraction...</p>
<p>Sometimes people use the terms connector and driver interchangeably, this can be confusing...</p>