Module, sending Node ID to template

Author Message

Håkan Bergman

Wednesday 19 May 2010 12:13:06 am

Hello,

I have made my own extension and is using this command to set node id in template:

$tpl->setVariable( 'node_id', $NodeID );

This works perfectly when I go to /extension?id=x. as I am using this to load a form I can't post to it directly, so I am fetching the variable by _GET command. But this works perfectly for any node id and is sent to template.

In my case however, the visitor clicks on a button called "Apply" and then a form loads through JS with colorbox. The form loads correctly and even though I specify the exact same extension path with ID, it won't pass it on to the template.

Should I send the variable in some other way to the template or do I need to call the variable that is being sent in some other way than just {$node_id} ?

Best regards,

Håkan Bergman

Håkan Bergman

Wednesday 19 May 2010 1:21:15 am

The site I dropped the extension at used /index.php?/ in the URL and confused the extension _GET variable. After removing and using /index.php/extension?id=x it worked again, so there was nothing wrong with the PHP code passing the template node_id.

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 11:36:25
Script start
Timing: Jan 18 2025 11:36:25
Module start 'layout'
Timing: Jan 18 2025 11:36:25
Module start 'content'
Timing: Jan 18 2025 11:36:26
Module end 'content'
Timing: Jan 18 2025 11:36:26
Script end

Main resources:

Total runtime0.7460 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.0083 589.0547152.6250
Module start 'layout' 0.00830.0031 741.679739.4609
Module start 'content' 0.01140.7330 781.1406422.9922
Module end 'content' 0.74440.0016 1,204.13288.1563
Script end 0.7460  1,212.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.5383160.0003
Check MTime0.00170.2310160.0001
Mysql Total
Database connection0.00100.132410.0010
Mysqli_queries0.693692.9718520.0133
Looping result0.00050.0696500.0000
Template Total0.694293.120.3471
Template load0.00290.387820.0014
Template processing0.691392.669520.3457
Template load and register function0.00030.037610.0003
states
state_id_array0.00190.254810.0019
state_identifier_array0.00190.250520.0009
Override
Cache load0.00250.3327130.0002
Sytem overhead
Fetch class attribute can translate value0.00110.149210.0011
Fetch class attribute name0.00200.264520.0010
XML
Image XML parsing0.00010.014210.0001
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00070.0919100.0001
String conversion0.00000.001140.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/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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 4

Time used to render debug report: 0.0001 secs