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.

eZ debug

Timing: Jan 18 2025 10:34:24
Script start
Timing: Jan 18 2025 10:34:24
Module start 'layout'
Timing: Jan 18 2025 10:34:24
Module start 'content'
Timing: Jan 18 2025 10:34:25
Module end 'content'
Timing: Jan 18 2025 10:34:25
Script end

Main resources:

Total runtime0.7468 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0125 588.0469152.6406
Module start 'layout' 0.01250.0027 740.687539.4922
Module start 'content' 0.01520.7304 780.1797586.8984
Module end 'content' 0.74560.0012 1,367.078112.1250
Script end 0.7468  1,379.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4501160.0002
Check MTime0.00130.1801160.0001
Mysql Total
Database connection0.00460.620110.0046
Mysqli_queries0.686091.8595590.0116
Looping result0.00060.0855570.0000
Template Total0.707694.720.3538
Template load0.00200.269320.0010
Template processing0.705694.478820.3528
Template load and register function0.00020.022510.0002
states
state_id_array0.00080.110210.0008
state_identifier_array0.00090.120920.0005
Override
Cache load0.00170.2275380.0000
Sytem overhead
Fetch class attribute can translate value0.00090.115130.0003
Fetch class attribute name0.00160.219740.0004
XML
Image XML parsing0.00080.107430.0003
class_abstraction
Instantiating content class attribute0.00000.001640.0000
General
dbfile0.00080.1073160.0001
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs