[TYPO3-ttnews] Hide news if no content is shown
Ralf Heydenreich
rheydenr at justmail.de
Sat May 26 17:09:34 CEST 2012
Hi all,
I want to hide the news block if there are no news to display. Therefore
I have defined a div tag around the news block where I can set the style
to "display:none" (works with TemplaVoilà). Unfortunately, I don't know
how to test if there's no content. The following solution does NOT work:
lib.field_event < plugin.tt_news
lib.field_event {
# ... some configuration stuff ...
displayLatest {
# Count the news items
subheader_stdWrap = COA
subheader_stdWrap {
# start/update counter
20 = LOAD_REGISTER
20.news_count.cObject = TEXT
20.news_count.cObject.data = register:news_count
20.news_count.cObject.wrap = |+1
20.news_count.prioriCalc = intval
}
}
}
lib.event_hider = TEXT
lib.event_hider.insertData = 1
lib.event_hider.value = display:none;
lib.event_hider.if.isFalse.data = register:news_count
The register value is ignored/not set (don't know how to test it). In
the plugin source code I found the (internal) variable
$this->internal['res_count']. Perhaps this could be used for external
access? Any hint is welcome...
TIA,
Ralf
More information about the TYPO3-project-tt-news
mailing list