Share » Forums » General » Publishing content from template...

Publishing content from template operator

Publishing content from template operator

Thursday 01 June 2006 2:51:58 am - 6 replies

Author Message

Kristof Coomans

Thursday 01 June 2006 3:09:44 am

Hi Eric

Where are you displaying the counter? You need to programmatically clear the view cache of the other objects where you display the counter.

include_once( 'kernel/classes/ezcontentcachemanager.php' );
eZContentCacheManager::clearContentCacheIfNeeded( $objectID );

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Nebojsa Eric

Thursday 01 June 2006 4:08:01 am

Cheers.

No. It doest`nt work. Output is the same. If I use admin section to clear content cache it works, from the code it does`nt work. I`ve tried cache-block expiry too, no help. Debug output: everything is OK.

eZContentCacheManager::clearContentCacheIfNeeded( $anodeObject->attribute( 'id' ) );
eZContentCacheManager::clearContentCacheIfNeeded( $ahomenodeObject->attribute( 'id' ) );

For example, I`m calling counter operator from home page for hit counter purpose. It can be any other purpose. $ahomenodeObject is my home page with nodeid 2 and objectid 1.

Maybe someone from eZ Crew can help?

Kristof Coomans

Thursday 01 June 2006 4:46:26 am

Do you display the counter in the module result or in the pagelayout template?

Try to clear the specific related caches one by one and see when your counter get's properly refreshed.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Nebojsa Eric

Thursday 01 June 2006 5:13:18 am

If I call it from pagelayout.tpl works fine. From {$module_result.content} works only when I clear content cache (all cache of course, content or template & content) in the admin section.

Kristof Coomans

Thursday 01 June 2006 11:02:38 pm

Put this at the beginning of the template where you're calling the counter:

{set-block scope=root variable=cache_ttl}0{/set-block}

Does it work now?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Nebojsa Eric

Friday 02 June 2006 4:09:47 am

Who`s the man? That`s it.

Tnx Kristof.

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu