Share » Forums » Setup & design » User-Specific caching

User-Specific caching

User-Specific caching

Saturday 21 May 2005 5:49:56 am - 2 replies

Author Message

Paul Borgermans

Saturday 21 May 2005 2:40:43 pm

Hi Marco,

1) You need to fetch the current user in the content {$module.result} related templates and use that to setup a cache block key

or

2) disable caching for that template.

But

3) I don't have that problem in my sites (all on 3.4.x though), so maybe you stumbled upon a bug. Can you provide more details (what policies are enabled and post the section statements where you check for $object.can_edit)

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Marco Zinn

Sunday 22 May 2005 10:58:54 am

Hi,
Hm. I'm talking about "node view full" and "node view line" templates, not the pagelayout.tpl.
I thought, i cannot create cache-block within content templates?, so i didn't get your 1) .
Currently, i use 2) ;)

So, these are the most important policy parts:

content  	 create  	 Node( Mitglieder ) , Class( Character ) , Section( Standard )
content 	edit 	Owner( Self )

This should allow users to create objects of the "Character" class as children of the (Folder) Node "Mitglieder". This works fine.
The second line should allow the users to edit "his own" objects ("character" objects or others).

Templates:
For the "Mitglieder" Node, there is an full view override.
Most important part:

<table>
<tr halign="top">
{section name=Child loop=$children sequence=array(bglight,bgdark)}
<td>
{node_view_gui view=line content_node=$Child:item}
</td>
{delimiter modulo=3}
</tr><tr>
{/delimiter}
{/section}
</tr>
</table>

As you see, i call the line template.

In that line template, used this code

{section show=$node.object.can_edit} (Daten bearbeiten: <a href={concat("content/edit/",$node.contentobject_id)|ezurl}><img src={"edit.gif"|ezimage} alt="Bearbeiten" /></a>){/section}

As this didn't work (the Edit-Button appeared for objects, which the current user was not allowed to edit), i moved this code into the full-view-template and disabled caching for this full view template with

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

Marco
http://www.hyperroad-design.com

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

36 542 Users on board!

Forums menu