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
|