pidInList or uidInList to query only subpages of a certain page?

Hi,

I’m currently trying to retrieve all pages that’re supages of a certain one like this:

lib.subs {
	table = pages
	wrap  = |

	select {
		orderBy       = sorting ASC
		languageField = pages.sys_language_uid
		pidInList 		= 1
		recursive     = 1
		selectFields  = slug, title, rowDescription, uid, pid
  }
  
  renderObj = COA
  renderObj {
		10 = TEXT
		10 {
			field = slug
			wrap  = {<<<°>>>slug<<<°>>>:<<<°>>>|<<<°>>>,
		}

...

Now I already tried to give “pidInList” the uid of the target page (pidInList = 56) and also tried “uidInList” instead but I get no results unless I use “pidInList = 1”. then I get the whole pages of the site and not just the subset I need.

Can anyone help me out on this?

Hi Salvatore,

I could imagine that your definition of the languageField could make problems.
Either it should be only sys_language_uid (as TYPO3 probably inserts the table name itself resulting in an invalid pages.pages.sys_language_uid)
or you can omit it as it is defined in the TCA already.

BTW: If you want to use the property uidInList you need to set pidInList = 0

Thanx for the hint. However ommiting that property didn’t bring any results either.

what object type is lib.subs?
that line is missing.

you have two options: RECORDS and CONTENT
only one will result in output.

this works for me:

lib.subs = CONTENT
lib.subs {
  table = pages
  wrap  = <table style="border:solid red 2px;">|</table>

  select {
    orderBy      = slug ASC
    pidInList    = 24
    recursive    = 1
    selectFields = slug, title, rowDescription, uid, pid
  }
  
  renderObj = COA
  renderObj {
    wrap = <tr>|</tr>
    1 = TEXT
    1.field = slug
    1.wrap = <td>&nbsp;|&nbsp;</td>
    2 < .1
    2.field = uid
    3 < .1
    3.field = pid
    4 < .1
    4.field = title
    5 < .1
    5.field = rowDescription
  }
}

It’s lib.subs = CONTENT. That’s strange that only pidInList = 1 results in an output while giving it any other number doesn’t. The page-uids I tried are existent in “pages”.
Maybe it has something to do with the type of page (1 is the uid of the root page of the site)?

did you try my typoscript?

how do you use the lib.sub? how do you output it?

Hi,
it’s working now. Thx a lot Bernd. Your Code was working and helped a lot.