tpl syntax in content (referencing my profile link)

Author Message

Tony Stark

Wednesday 13 February 2008 3:07:40 am

Apologies, no doubt a newbie question....Is there a way to add/insert tpl syntax which will be parsed on output? i.e. what I was trying to do was add content which contains a hyperlink to the "My Profile" page so when a user is signed in they can edit their content. probably not possible and a template will be required....just thought I would ask!

Abdelkader RHOUATI

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

Chirag Patel

Monday 21 February 2011 12:53:35 pm

Hi,

I have posted a similar question. I have some confusion about difference between "create" and "edit".

Could you please answer it there?

http://share.ez.no/forums/general/how-to-let-users-add-content-objects

Thanks

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.