0
votes

i am new to typoscript. I tried to render content from some subpages on an archive page.

I am not sure why my code is displaying nothing.

Firstly I am trying to iterate through my subpages

within that code

  stdWrap.wrap = <div class="row"> | </div>
table = pages
select {
    orderBy = sorting
    # If this element is inserted as sitemap, consider the startingpoint
    pidInList.field = uid
    #max = 1
    begin = 0
  }

Secondly i am itarating through my tt_content table and trying to get the value of the column header and render that on my archive page.

The Code is working until

<div class="row"> | </div>

Full Code here:

lib.content = COA
lib.content {
  stdWrap.wrap = <div class="row"> | </div>
    table = pages
    select {
            orderBy = sorting
        # If this element is inserted as sitemap, consider the startingpoint
            pidInList.field = uid
      #max = 1
      begin = 0
        }
    renderObj = COA
    renderObj {
      stdWrap.wrap = <div class="testfestinner"> | </div>

      10 = CONTENT
      10.wrap = <h3>|</h3>
      10 {
        table = tt_content
                select {
                    pidInList.field = uid
                    where = colPos = 212
                    orderBy = sorting
                }

        renderObj = COA
        renderObj.10 = TEXT
        renderObj.10.field = header
      }
    }
}

I am not sure where and how to debug that code. Thanks in advance.

1
If u have a better idea to create a archive page. Please let me know. - RacoonOnMoon
as Joey said: your lib.content needs to be a CONTENTobject. an alternative to your outer CONTENT object could be a HMENU (any list of pages/page-uids could be a menu) where you add your inner CONTENT. pro: you could organize your archives even in a page tree instead of a long list of subpages in one level. - Bernd Wilke πφ

1 Answers

1
votes

Something like table = pages can not be assigned to a COA directly. You need a cObject of the type CONTENT for that purpose. Just like the one you assigned to the renderObj.