[TYPO3-english] Get "upcoming" content elments with CONTENT

Bernhard Kraft kraftb at kraftb.at
Sun Oct 4 23:34:49 CEST 2009


Sebastian Gebhard schrieb:
> When I use CONTENT it fetches records according to the enableFields of
> tt_content. So CEs with starttime > time() are not fetched.
> Is it possible to get those somehow?

Hello!

Ney. This is quite hardcoded (see
typo3/sysext/cms/tslib/class.tslib_content.php - method "getWhere")

You have a hardcoded "enableFields" in there. You could probably work
around this using "RECORDS" instead of "CONTENT" cObj. But then you'll
need to know the uid'S of the records which are going to get fetched.


I do not know what your exact goal is - but it could be a solution, to
add an additional time field to tt_content, use this field to display
your content-elements appropriate (so add it to the "andWhere" of the
CONTENT object displaying your normal content).

And then you could easily create and "andWhere" condition for the
CONTENT object you wrote about - where you want to display "hidden" records.

So in fact those records would not really be hidden throughout TYPO3.
Especially in the BE they would show up like usual. But you can easily
modify your TypoScript showing the content-elements to respect your
additional time field.



Another possible solution would be, to use a hook in "tslib_content" to
create your own "CONTENT" object. Like "CONTENT_NOENABLE". Then you
simply create your hook class, where you create a class like:

class tx_myext_content extends tslib_content {

and overwrite "function getWhere" and do not call "enableFields" in your
version (or make it dependen on a TypoScript setting).

Since 4.1 or 4.2 you have a hook in tslib_content which allows such
things. Search for comment "Application defined cObjects" in tslib_content.


greets,
Bernhard


More information about the TYPO3-english mailing list