Forums / Developer / Editing and templates?

Editing and templates?

Author Message

Clemens T

Tuesday 15 February 2005 3:51:12 am

I want to make sure that a certain group of users with the right permissions offcourse see a edit-button when they read an article. But this button shouldn't be visible for users that don't have the edit-policy in their role for that section/page etc. Howto?
Thanks a lot!!
Clemens

Eivind Marienborg

Tuesday 15 February 2005 4:37:06 am

Insert this into your template:

{section show=$node.object.can_edit}
<form method="post" action={"content/action"|ezurl}>
<input type="hidden" name="ContentNodeID" value="{$node.node_id}" />
<input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
<input type="hidden" name="ViewMode" value="full" />
<div class="editbutton">
   <input class="button" type="submit" name="EditButton" value="{'Edit'|i18n('design/standard/node/view')}" />
</div>
</form>
{/section}

Clemens T

Tuesday 15 February 2005 5:06:08 am

Holy cow, that did the trick! Thanks a lot... wouldn't know how to do it without your help!
Thanks,
Clemens