Forums / Developer / Clearing cache after changing priority [solved]
Atle Pedersen
Wednesday 21 March 2007 9:51:36 am
Hi!
After much pain and hard work I finally understood how to use viewcache.ini to clear cache for other nodes than the one I'm publishing new nodes under.
Hovewer there's still one problem with cache. I allow an editor to usa a homemade interface to change the priorities of certain objects, in order to sort them correctly. But changing priority/srot order does not seem to clear any cache.
Is there a sollution to this problem?
Kristian Hole
Wednesday 21 March 2007 9:58:23 am
Hi Atle,
If the viewcache is configured properly it should clear the viewcache when you are changing priorities.
If you are doing it from PHP, then you might need to use eZContentCacheManager::clearObjectViewCache to clear the view cache for your object.
Kristian http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute
Wednesday 21 March 2007 10:15:28 am
I'm trying to do this from a template using the following html and template code:
<form method="post" action={"/content/action"|ezurl}> <input type="text" name="Priority[]" size="3" value="{$person.priority}" title="" /> <input type="hidden" name="PriorityID[]" value="{$person.node_id}" /> <input type="hidden" name="ContentNodeID" value='{$listenid}' /> <input type="hidden" name="redirecthack" value="{$node.url_alias}" /> <input type="hidden" name="ContentObjectID" value='{$objecth[$listenid]}' /> <input type="submit" name="UpdatePriorityButton" value="Endre prioritet" title="Høyere prioritet vises tidligere" /> </form>
$listenid is a node id and $objecth[$listenid] is the objectid of the same node.
Wednesday 21 March 2007 10:53:33 am
Ahh.. you put me on the right track, Kristian. Thanks.
I read the source code and found that ContentObjectID is used for clearing cache. So it was a matter of changing this variable.
<input type="hidden" name="ContentObjectID" value='{$node.object.id}' />
That was definitely the end of work for today. :)