[TYPO3-ttnews] fe_rtenews & page cache

Alan Carpenter typo3 at bridgeclubs.org
Wed Apr 12 10:13:32 CEST 2006


>>Alan Carpenter wrote:
>> I'm trying to setup website users so that they can submit news that 
>> gets published immediately (using queuePublish = 0). While it creates 
>> the news item correctly, it will not display the news item until the 
>> page cache for the News page is cleared.[snip] Any suggestions?

>Kasper Ligaard Nielsen wrote:
>Setting TSconfig on the page where newsitems are stored to:
>     TCEMAIN.clearCacheCmd = <list-of-where-pages-are-shown>
>SHOULD work - but it does not (at least not for me...).
>[snip]
>regards, Kasper

Thanks for the replies Kasper and Claudio. I decided to work around this
problem locally. I modified ./ext/fe_rtenews/pi1/class.tx_fertenews_pi1.php
to add this code after the Insert query:

$cacheCmd = intval($this->conf['newsPID']);

if ( $cacheCmd )
{
	if ( $GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages','page_id='
. $cacheCmd) )
	{
		$content .= "<p>Page cache cleared</p>";
	}
}

There seems be a disconnect when a record is put into non-cache mode such
that the page container doesn't get its cache invalidated and this code
fixes that for this particular case. I wanted a solution that only
invalidates the page cache when a newly submitted news record is created. It
would seem wasteful to always bypass the page cache for news.

In any event this solved my issue for now. I'm new to all this, so this
seemed the most expedient. Feel free to suggest what else I might have done.

While I was in there I added the capability to send e-mail to the author (as
well as mailAdmin) if their e-mail was given, and to include the body of the
news article as well.

Cheers,
Alan






More information about the TYPO3-project-tt-news mailing list