Delete Post only if Admin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Delete Post only if Admin

Coleen_Astalos
This post was updated on .
I'm trying to show the "Delete Post" option only if the user is Admin.

<override_macro name="post_dropdown" requires="node"> 
<n.dropdown.
        id="postdropdown[n.id/]"
        text="[t]More[/t]"
        title="[t]Click for more options[/t]"
        loadOnClick="/template/NamlServlet.jtp?macro=post_dropdown_later&node=[n.id/]"
    >
        <n.menu_reply_to_author/>
        <n.menu_edit_post/>
        <n.menu_move_post/>
        <n.if.visitor.is_site_admin>
            <then>
                <n.menu_delete_post/>
            </then>
        </n.if.visitor.is_site_admin>
        <n.menu_change_post_date/>
        <n.menu_print_post/>
        <n.menu_permalink/>
        <n.menu_raw_mail/>
    </n.dropdown.>
</override_macro>

But I'm getting an error when I bring up any post: Can't get visitor on cached page

What am I doing wrong?
Thanks,
Coleen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Delete Post only if Admin

Pedro <Nabble>
Please, edit your can_delete macro like this:
<override_macro name="can_delete" requires="user" dot_parameter="node_attr">
    <n.is_site_admin/>
</override_macro>
My test forum.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Delete Post only if Admin

Coleen_Astalos
Thanks - perfect.
Coleen
Loading...