Forums / Developer / tpl syntax in content (referencing my profile link)

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

eZ debug

Timing: Jan 18 2025 03:00:34
Script start
Timing: Jan 18 2025 03:00:34
Module start 'content'
Timing: Jan 18 2025 03:00:34
Module end 'content'
Timing: Jan 18 2025 03:00:34
Script end

Main resources:

Total runtime0.2121 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 591.5078180.8125
Module start 'content' 0.00600.0064 772.320398.0547
Module end 'content' 0.01240.1996 870.3750526.0000
Script end 0.2120  1,396.3750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00452.1350200.0002
Check MTime0.00150.6907200.0001
Mysql Total
Database connection0.00090.416310.0009
Mysqli_queries0.159275.04471410.0011
Looping result0.00130.62141390.0000
Template Total0.199293.910.1992
Template load0.00080.398010.0008
Template processing0.198393.516410.1983
Override
Cache load0.00060.279110.0006
Sytem overhead
Fetch class attribute can translate value0.00110.518710.0011
XML
Image XML parsing0.00040.170210.0004
General
dbfile0.00492.2930200.0002
String conversion0.00000.002830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs