How do you pass variables through the object creation/publish machinery?

Author Message

nigel dodd

Friday 04 February 2005 3:22:57 am

Take the tscm example http://www.ez.no/ez_publish/documentation/building_an_ez_publish_site/the_guestbook/adding_an_action_button where a guestbook object is initially created using content/action with the NewButton input. This results in the appearance of an editing template for the user to fill in the various attribute values of the guestbook class. This can be overridden, as demonstrated in the documentation, to provide a bespoke editing form.

If I had a variable in the template containing the content/action form, how would I be able to pass this value to the edit template? The normal appending of /(myvariable)/myvalue to the url does not work here.

nigel dodd

Friday 04 February 2005 9:28:50 am

Use the hack
http://ez.no/community/contribs/hacks/one_click_new_object_and_publish_preview_hack
which eliminates the need for the two stage creation/publish of content/action NewButton and replaces it with a single stage where the relevant variables are available and can be inserted into attribute values.

I would suggest that a more fully coded version of this excellent "hack" finds its way into the release code. It needs extending to accomodate other variable types than just text variables. I shall endeavour to do so for integers and post the result.

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 22:11:28
Script start
Timing: Jan 18 2025 22:11:28
Module start 'layout'
Timing: Jan 18 2025 22:11:28
Module start 'content'
Timing: Jan 18 2025 22:11:29
Module end 'content'
Timing: Jan 18 2025 22:11:29
Script end

Main resources:

Total runtime0.5555 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.3516152.6563
Module start 'layout' 0.00480.0023 741.007839.4922
Module start 'content' 0.00710.5469 780.5000458.6875
Module end 'content' 0.55390.0016 1,239.18758.2344
Script end 0.5555  1,247.4219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.5605160.0002
Check MTime0.00120.2249160.0001
Mysql Total
Database connection0.00070.122910.0007
Mysqli_queries0.510991.9653520.0098
Looping result0.00050.0885500.0000
Template Total0.528495.120.2642
Template load0.00170.315020.0009
Template processing0.526694.795820.2633
Template load and register function0.00020.035510.0002
states
state_id_array0.00070.118310.0007
state_identifier_array0.00100.180320.0005
Override
Cache load0.00140.2535120.0001
Sytem overhead
Fetch class attribute can translate value0.00130.232910.0013
Fetch class attribute name0.00130.236530.0004
XML
Image XML parsing0.00250.456910.0025
class_abstraction
Instantiating content class attribute0.00000.002040.0000
General
dbfile0.00370.6576160.0002
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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs