Wednesday 13 February 2008 4:13:45 am
hi,
If I understood correctly. you want to be able to edit content from template. you can see the module: content / edit 1- Adding a button that creates a new node :
<form method=”post”
action={‘/content/action’|ezurl}>
<input type=”submit” name=”NewButton”
value=”Create a new folder” />
<input type=”hidden” name=”ClassID”
value=”1” />
<input type=”hidden” name=”NodeID”
value=”2” />
</form>
2- checking for the following access methods:
create
edit ..
3- The edit template Every time a node is created or edited, eZ publish will attempt to load the edit template (design/example/templates/content/edit.tpl).
[xxxx_edit]
Source=content/edit.tpl
MatchFile=xxxx_edit.tpl
Subdir=templates
Match[class_identifier]=xxxx
4- Clear the caches and verify that the custom edit template is used and that it works correctly.
5- Automatic redirection after editing It is possible to instruct the system to redirect the user to a specific page when editing is done. This can be achieved by adding a hidden variable called RedirectAfterPublish to the form that takes care of creating new nodes.
<input type=”hidden” name=”RedirectAfterPublish”
value=”/company/about” />
***************************************************** and for edditing :
6- Adding an edit button The following template code shows how a button that triggers the editing of an existing node can be added. The example assumes that the code is placed within a node view template (hence the use of the $node variable - if not, the node must be manually fetched and assigned to the variable). Note that both the node ID and the object ID must be provided.
<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=”submit” name=”EditButton”
value=”Edit” />
</form>
The edit action can also be triggered by using a hyperlink instead of a submit button in a form. The link must contain the ID number of the target object. The following example shows how this can be done.
<a href={concat( ‘/content/edit/’,$node.object.id )|ezurl}>Edit</a>
(Recpecter for the rights of author, these instructions are taken from a pdf EZ_publish_basics_Balazs_Halasy_calosc_12_VI_300_dpi.pdf, I do not know where I have.) tks. Abdelkader.
Abdelkader RHOUATI
Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery
|