[TYPO3-core] RFC Bug #10050: Traversing back page records used in CONTENT object does not work on root page

Bernhard Kraft kraftb at kraftb.at
Tue May 5 06:55:55 CEST 2009


Oliver Hader wrote:

> Problem:
> The TypoScript object CONTENT allows to traverse back the rootline until
> something valid was found with the following:
> 10 = CONTENT
> 10 {
>   table = pages
>   select.where = media!=''
>   slide = -1
> }
> This would select any page that has the media field filled.
> However, this does not work if the record that is expected to be fetched
> is on the root page and thus has the pid 0.

This is not quite correct. the "slide" features is used for traversing back
the rootline, until some records (tt_content) are found on a page.

You want to traverse back the table "pages" until some value for the "pages"
record is valid. This is (and was) already possible with an "prehistoric"
feature of TYPO3 "levelmedia" or "leveluid" ... instead of your above TS use:

10 = TEXT
10.data = levelmedia : -1 , slide

See:
<http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.2.0/view/1/2/#id4714659>
(and search for "levelmedia")

 From TSref:
---------------------------------------------------------------------------
leveltitle, leveluid, levelmedia: [levelTitle, uid or media in rootLine, 0- ,
negative = from behind, “ , slide” parameter forces a walk to the bottom of
the rootline until there's a “true” value to return. Useful with levelmedia.]

levelfield: Like “leveltitle” et al. but where the second parameter is the
rootLine field you want to fetch. Syntax: [pointer, integer], [fieldname],
[“slide”]
---------------------------------------------------------------------------

Of course, if you use "levelfield" the field you are going to use has to be
found in the rootline - so you eventually have to add it to the config value:
$TYPO3_CONF_VARS['FE']['addRootLineFields']


I saw that you reported this bug - so I guess it is something you need for your
work - I assume it is easier and quicker for you, to use the method I described ;)

But still: +++1 for your patch - I already messed around quite a long time with
this problem, ending up with an XCLASS - it does not only concern the "slide"
feature, but is a problem anytime you want to select a record from the root page
(like any "static_country" record, etc.) ... Some time ago a patch was introduced
allowing to select "static_" tables using the "CONTENT" TypoScript object:
sysext/cms/tslib/class.tslib_content.php / line 1282, at the very end:

if ($conf['table']=='pages' || substr($conf['table'],0,3)=='tt_' || substr($conf['table'],0,3)=='fe_' || substr($conf['table'],0,3)=='tx_' || substr($conf['table'],0,4)=='ttx_' || substr($conf['table'],0,5)=='user_' || substr($conf['table'],0,7)=='static_') {

But still this has no sense without your patch ... So as you have my +++1 (!) and
the one from Susanne ... go on and commit it.


greets,
Bernhard
-- 
Freiheit ist immer Freiheit des Andersdenkenden.
Rosa Luxemburg, 1871-1919
--------------------------------------------------
www.think-open.at


More information about the TYPO3-team-core mailing list